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

bug in the sage preparser -- vector(v)[3] = 5 slips by! #3846

Closed
williamstein opened this issue Aug 14, 2008 · 3 comments
Closed

bug in the sage preparser -- vector(v)[3] = 5 slips by! #3846

williamstein opened this issue Aug 14, 2008 · 3 comments
Assignees

Comments

@williamstein
Copy link
Contributor

The Sage preparser stupidly doesn't raise an error when the input is vector(v)[3] = 5. Instead
it does something very confusing. This was found by Franco Saliola.

sage: vector(v)[3] = 5
sage: preparse('vector(v)[3] = 5')
'_=var("v");vector=symbolic_expression(Integer(5)).function(v)'
sage: vector(10)
5

CC: @robertwb @boothby

Component: misc

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

@williamstein
Copy link
Contributor Author

comment:1

Here's another funny example:

sage: foo(x,y)hithere fred wuz up?!  how is going = x+y
sage: foo(2,3)
5

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Feb 11, 2009

comment:2

I can no longer reproduce this example in Sage 3.3.rc0. Can someone decide what needs to happen with this bug?

Cheers,

Michael

@mwhansen
Copy link
Contributor

mwhansen commented Jun 4, 2009

comment:3

This looks fixed to me in 4.0.1:

----------------------------------------------------------------------
| Sage Version 4.0.1.rc1, Release Date: 2009-06-04                   |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
sage: 'vector(v)[Integer(3)] = Integer(5)'
'vector(v)[Integer(3)] = Integer(5)'
sage: sage: foo(x,y)hithere fred wuz up?!  how is going = x+y
------------------------------------------------------------
   File "<ipython console>", line 1
     foo(x,y)hithere fred wuz up?!  how is going = x+y
                   ^
SyntaxError: invalid syntax

@mwhansen mwhansen removed this from the sage-4.0.1 milestone Jun 4, 2009
@mwhansen mwhansen closed this as completed Jun 4, 2009
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

2 participants