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

Precedence issue with ":" #166

Open
szhorvat opened this issue Jun 30, 2020 · 0 comments
Open

Precedence issue with ":" #166

szhorvat opened this issue Jun 30, 2020 · 0 comments
Assignees

Comments

@szhorvat
Copy link
Contributor

Describe the bug

x y : z is parsed as Optional[Times[x, y], z], according to the Wolfram Language -> Show FullForm menu item. This is also reflected in how the incremental selection works ("expand selection").

The correct parsing is Times[x, Pattern[y, z]]. There are two problems here: (1) precedence of : vs implicit multiplication (2) confusion between Optional and Pattern.

Let us look at another example:

x y_ : z (notice the _) is parsed as Optional[Times[x, Pattern[y]], z].

The correct parsing is Times[x, Optional[Pattern[y, Blank[]], z]]. Again, two issues: (1) precedence of : vs implicit multiplication (2) Pattern[y] vs Pattern[y, Blank[]]

As far as I can tell, in both cases it is only (1) that affects the functionality of the plugin, and (2) can be ignored. It affects incremental selections.

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