[Date Index] [Thread Index] [Author Index]
Re: Until -Reply -Reply
Sean: >The forms: >.....; or yours > Until[test_,body_]:=While[test=!=True,body]; >work fine, but are not a true Until because they don't execute body first. Mine is SetAttributes[Until,HoldAll] Until[test_, body_]:= While[body;test=!=True] and does execute body first: i=1;Until[True,i++];i 2 Am I missing something? Allan Hayes Thanks for the help. Your code does work and yes, you are missing something. As an "insider", you were aware of an undocumented While feature when I assumed that your While[body,test] was just a typo that I saw no need to quibble about. The mathematica book does not mention that While[test,body] evaluates test first, then body and While[body,test] does the reverse. I will promptly "Update" my personal copy of the mathematica book. This would probably make a nice addition to the list of revisions you are compiling somewhere.