Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"0 = x" is preparsed very badly #24971

Open
kcrisman opened this issue Mar 14, 2018 · 4 comments
Open

"0 = x" is preparsed very badly #24971

kcrisman opened this issue Mar 14, 2018 · 4 comments

Comments

@kcrisman
Copy link
Member

sage: preparse("0 = x")
'__tmp__=var("0"); Integer = symbolic_expression(x).function(0)'

This is because 0 = x becomes Integer(0) = x which is interpreted as defining a function Integer in the variable 0.

Observed in this ask.sagemath question.

CC: @slel

Component: user interface

Keywords: preparser

Issue created by migration from https://trac.sagemath.org/ticket/24971

@kcrisman kcrisman added this to the sage-8.2 milestone Mar 14, 2018
@kcrisman

This comment has been minimized.

@jdemeyer
Copy link

comment:2

This must happen because of double preparsing:

0 = p

becomes

Integer(0) = p

which is interpreted as a function definition of the function Integer in the variable 0.

@jdemeyer

This comment has been minimized.

@jdemeyer jdemeyer changed the title Very subtle preparser error in functions only "0 = x" is preparsed very badly Mar 14, 2018
@slel
Copy link
Member

slel commented Oct 9, 2020

Changed keywords from none to preparser

@mkoeppe mkoeppe removed this from the sage-8.2 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants