MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

Until


Mathematica has a built-in While[test,body] stucture where the test is evaluated
and if true, body is evaluated until test fails.
I would like an Until structure where the body is evaluated until a test is
true.  Logically, 

Until[test_,body_]:=body:
                         While[Not[test],body]

but the above code doesn't work.  I am guessing it has something
to do with a Hold-type attribute, but I haven't been able to figure it out.  Does
anyone know how to conventiently make a new construct like the Until structure
above?  Related is how can I make my own function which will accept as an
argument an expression like Integrate accepts for its first argument?  Thanks.
Sean.


  • Prev by Date: MMA 3.0 buggy on NextStep/Intel?
  • Next by Date: Re: coefficient of constant term (Q:)
  • Previous by thread: Re: MMA 3.0 buggy on NextStep/Intel?
  • Next by thread: Re: coefficient of constant term (Q:)