Re: if-expression and variables
Bill Page <[email protected]> Tue, 3 May 2011 00:17:47 -0400
| Newsgroups | gmane.comp.mathematics.axiom.general |
|---|---|
| Message-ID | <[email protected]> |
Oops, I forgot that 'parse' was never implemented in the InputForm domain in the original Axiom. In this case use: parse(s:String):InputForm =3D=3D ncParseFromString(s)$Lisp Regards, Bill Page. On Mon, May 2, 2011 at 11:57 PM, Bill Page <[email protected]> wro= te: > > Now the function that Stefan has in mind can be written in a fairly > transparent manner. > > (3) -> ex:InputForm :=3D parse("if x<10 then 2*x else 5*x^2"); expr ex > > =A0 (3) > =A0 if x < 10 > =A0 =A0 then 2x > =A0 =A0 =A0 =A0 =A0 =A02 > =A0 =A0 else 5x > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Type: OutputForm > > The function 'parse' returns an unevaluated input form for the > expression inside "...". The function 'expr' prints this in a readable > manner. (InputForm is displayed in this form by default in OpenAxiom.) >