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

a'b ambiguous with a'[1,1] #43654

Open
zsoerenm opened this issue Jan 4, 2022 · 3 comments
Open

a'b ambiguous with a'[1,1] #43654

zsoerenm opened this issue Jan 4, 2022 · 3 comments
Labels
deprecation This change introduces or involves a deprecation parser Language parsing and surface syntax

Comments

@zsoerenm
Copy link
Contributor

zsoerenm commented Jan 4, 2022

Today I stumbled over this ambiguity:

a = [2, 1]
b = [1, 1]
a'b # outputs 3
a'[1, 1] # outputs 2

a'[1, 1] here is the first entry of a'.
What's the purpose of the syntax a'b instead of a' * b? Could the syntax a'b be removed to avoid this ambiguity?

@Keno Keno added the parser Language parsing and surface syntax label Jan 4, 2022
@Keno
Copy link
Member

Keno commented Jan 4, 2022

I think the second of these should be disallowed as ambiguous and parentheses required.

@JeffBezanson
Copy link
Member

The thing is, as far as I know it's never possible to juxtapose an expression with [...], since that is by definition the syntax for indexing. So this doesn't bother me too much. We could disallow the special case of x'[ ] I guess, since that's probably rarely used, but still technically breaking.

@JeffBezanson JeffBezanson added the triage This should be discussed on a triage call label Jan 5, 2022
@oscardssmith oscardssmith added deprecation This change introduces or involves a deprecation and removed triage This should be discussed on a triage call labels Jan 6, 2022
@oscardssmith
Copy link
Member

triage thinks deprecation is the right answer here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecation This change introduces or involves a deprecation parser Language parsing and surface syntax
Projects
None yet
Development

No branches or pull requests

4 participants