Page 1 sur 1
equal prefix cmds
Publié : lun. avr. 09, 2018 2:35 pm
par compsystems
Hello BP, why when generating the equation equal(y,x^2) is defined later as y:=x^2, I think this is not very useful, because within the code it is very recurrent to make expressions that remain as they are.
equal2list(equal(x+1,2))*6 the output should be list[ 6*x+1, 6*2 ], and not a sequence 12*(x+1)
Re: equal prefix cmds
Publié : mar. avr. 10, 2018 11:10 am
par parisse
= is sometimes evaled to := for compatibility reason (inside programs).
Re: equal prefix cmds
Publié : mar. avr. 10, 2018 8:40 pm
par compsystems
but in the worksheet, is better not to evaluate to :=
example
1: y=x^2
2: subst(ans(-1),[x=-1,y=1]) returns 1 =( expected 1=1
Re: equal prefix cmds
Publié : mer. avr. 11, 2018 6:27 am
par parisse
Just give a name to your objects (and avoid ans)
eq:=y=x^2; subst(eq,[x=-1,y=1])
= is evaluated like := at top-level because many users from other programming languages forget the :, but this is done only at top-level.