Hi Emmanuel,
On 2019-03-19, Jeroen Demeyer <[email protected]> wrote:
> On 2019-03-19 12:52, Emmanuel Charpentier wrote:
>> Defining a symbolic function seems to declare its arguments.
>
> I tend to think that everything on the left of the '=' sign in an
> assignment is stuff that is assigned to. So
>
> (a, b, c) = range(3)
>
> assigns to a, b and c.
>
> R.<x> = ZZ[]
>
> assigns to R and x.
>
> func(x) = x
>
> assigns to func and x.
>
> So in this sense, it's expected.
Some addition: While the first example
(a,b,c) = range(3)
is standard Python behaviour, the other examples work because Sage uses
a preparser to make it possible to use nicer syntax in maths:
f(x) = x^2
is a lot more concise and easier to understand for non-programmers than
__tmp__=var("x"); f = symbolic_expression(x**Integer(2)).function(x)
(which is what the preparser makes of it).
Best regards,
Simon
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.