What is the difference between two ways to instantiate a variable?
29 views
Skip to first unread message
Jim Mooney
unread,
May 4, 2017, 7:02:11 PM5/4/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sage-support
Why do I sometimes see just var('y') and other times see y = var('y')? The result seems to be the same since I can use y in either case.
Nils Bruin
unread,
May 5, 2017, 1:05:27 AM5/5/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sage-support
On Thursday, May 4, 2017 at 4:02:11 PM UTC-7, Jim Mooney wrote:
Why do I sometimes see just var('y') and other times see y = var('y')? The result seems to be the same since I can use y in either case.
See the doc of SR.var and var.
y=SR.var('y')
is the "fundamental" construct, and assignment is required.
For interactive use, `var("y")` can be used. It needs some dark magic to inject the bindings. `y=var('y")` basically binds y twice. It's a matter of taste which you prefer.