[Date Index] [Thread Index] [Author Index]
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.