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

Strange behaviour of ~ #1049

Closed
frankluebeck opened this issue Jan 6, 2017 · 3 comments
Closed

Strange behaviour of ~ #1049

frankluebeck opened this issue Jan 6, 2017 · 3 comments

Comments

@frankluebeck
Copy link
Member

Observed behaviour

gap> a~ := 1;
Syntax error: ; expected
a~ := 1;
 ^
gap> ~a := 1;
Syntax error: ; expected
~a := 1;
 ^
gap> ~ := 1;
1
gap> l := [2, ~];
[ 2, ~ ]
gap> l = l[2];
true

Expected behaviour

The assignment ~ := 1; should lead to the same syntax error as the first examples.

Copy and paste GAP banner (to tell us about your setup)

Seems that this has been in all version of GAP4 (and also in GAP3, where only the last line behaves differently).

@ChrisJefferson
Copy link
Contributor

Some other bad places we can put ~ (noting them, while I look around)

f := function() local a,~,b; end;

f := function(a,~) end; and ~ -> ~

@ChrisJefferson
Copy link
Contributor

This is tricky to fix, without possibly slowing GAP down -- the obvious places to fix it would involve putting code in places that have to be fast.

I'm investigating making ~ read-only from a user point of view (that would lead to a run-time error, rather than a parse-time error, but still stop it being written to).

@ChrisJefferson
Copy link
Contributor

I have a fix for this, but it requires first merging #490 (just because they touch the same code, so there would be a merge conflict otherwise).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants