Movatterモバイル変換


[0]ホーム

URL:


do...until wisdom needed...

Ken PeekPeek at LVCM.comNOSPAM
Mon Apr 16 09:55:51 EDT 2001


OK--I will repeat a private email I sent to Paul Foley:I am writing my own language based on Python for deeply embedded systems.  Iam not trying to change the Python language.  I would like all of thetraditional looping constructs in my new language, and so was trying to getyour opinion as to the best way to implement a "do...until" construct.  Yes,I know that the "while" construct CAN be used, but it is not the "syntacticcandy" that we have all come to know and love.  I also plan on adding alogical XOR operator, a logical shift right, and a few other things such asabsolute static typing, constants, constant pointers (for directing absoluteI/O in memory mapped I/O systems), etc. etc.So, now that you know that I really am asking what I said I was asking, howabout answering my original question?--Thanks"Andrew Dalke" <dalke at acm.org> wrote in messagenews:9be82a$eq7$1 at slb6.atl.mindspring.net...> Ken Peek wrote:> >Thank you for the history lesson.  My question still stands--  I> >don't care if it will be implemented or not.  I am looking for> >what would be the correct "Pythonic" construct if it WERE implemented...>> >"Terry Reedy" <tjreedy at udel.edu> wrote:> >> This has been discussed ad nauseum for years with no agreement.  If and> >> when maillist or newsgroup archives are available, you can review at your> >> leisure.>> But that's Terry's point.  No one has decided on a "Pythonic"> construct, and there have been arguments on that topic.  Nor> did he mention anything about implementation.>> I just did a www.python.org/search for "do while until".  The> first hit was to:>http://groups.google.com/groups?q=do+while+until&hl=en&lr=&group=comp.lang.p> ython.*&safe=off&rnum=1&seld=943960637&ic=1> and since I don't know if that link will really work, the thread> is named "why no "do : until"? and took place last December.> (There are older threads, but not indexed by Google.)>> The consensus seems to be that there is no Pythonic syntax for> a do/until construct.  It boils down to indentation.  Both your> suggestions were proposed and it was decided that they didn't> make sufficient sense:>>   do:>     spam>     until cond>> was found to be nothing more than an alias for>>   while 1:>     spam>     if not cond: break>> and not worth introducing new syntax.>> The other proposal is:>>   do:>     spam>   until cond>> but this "does not fit a pythonic pattern for statements"> (Martijn Faassen).  Reread the full thread for details.>> So why didn't you believe that this exact history you were> looking for already existed in the easily searchable archives,> even after Terry pointed it out?>>                     Andrew>dalke at acm.org>>>>>>>


More information about the Python-listmailing list

[8]ページ先頭

©2009-2025 Movatter.jp