Following up on this, I think we can do this with relatively small impact:

https://github.com/sagemath/sage/pull/38780

previously,

limit(1/x,'+',x=0)

did work, but the recommended way to spell this was

limit(1/x,x=0,dir="+")

so I'm not sure if we need to provide a special case and intercept this.



On Thursday 3 October 2024 at 09:07:29 UTC-7 Nils Bruin wrote:

> The function in question is sort-of available as 
> sage.functions.other.symbolic_limit (which is an inert form, so it requires 
> a further "simplify").
>
> On Thursday 3 October 2024 at 08:29:50 UTC-7 Nils Bruin wrote:
>
>> On Thursday 3 October 2024 at 04:44:12 UTC-7 Emmanuel Charpentier wrote:
>>
>> sage: F.limit(X[0]=3) Cell In[9], line 1 
>> F.limit(X[Integer(0)]=Integer(3)) ^ SyntaxError: expression cannot contain 
>> assignment, perhaps you meant "=="? 
>>
>> Indeed, the current limit function and method get their arguments 
>> (variable and value) by analysing a single named argument, whose name must 
>> be a literal. From limit?? :
>>
>> The restriction here is python's processing of optional arguments. These 
>> must have simple names.  You can already use
>> """
>> limit(x0,**{str(X[0]):1})
>> """
>> now, which isn't beautiful but at least it establishes the function. 
>> Allowing an explicit dictionary argument would likely open up a whole slew 
>> of other issues. It looks to me like we're missing a very simple form for 
>> limit that should be the primitive to all of this:
>> limit( f, x, 1)
>> i.e.: expression to take limit of, variable with respect to take limit, 
>> limit value. Then one could just write limit( F, X[0], 0) and one would get 
>> the default processing of arguments for python for free. We wouldn't rely 
>> on the programmatic pun of using python identifiers to stand in for our 
>> symbolic variables.
>> Further convenience routines that use syntactic sugar to make things 
>> resemble more mathematical notation can then be built on top, but at least 
>> the general primitive is available underneath.
>> It may be hard to figure out a way to make such a routine available under 
>> an easily found name while remaining compatible with what exists now.
>>
>

-- 
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 sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/6f0613de-e253-45ab-9694-ff099b105eb9n%40googlegroups.com.

Reply via email to