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

Suppor referring to variables with meta characters in their names #946

Open
xiaq opened this issue Mar 22, 2020 · 0 comments
Open

Suppor referring to variables with meta characters in their names #946

xiaq opened this issue Mar 22, 2020 · 0 comments

Comments

@xiaq
Copy link
Member

@xiaq xiaq commented Mar 22, 2020

We have builtin functions with meta characters in their names, such as !=. It is not possible to refer to their corresponding variables ($!=~ is not valid).

To fix that, we can support quoted variable names. The $ sign can be followed by a quoted string, and the string specifies the variable names. For example, the variable for != can be written as $"!=~" or $'!=~'. Note that since this works on the primary node level, the variable name must be given inside a single string: $'!='~ refers to a variable called !=, then concatenated with ~.

This won't break any existing code since the character sequence $" and $' are invalid syntax now.

Moreover, the LHS of assignments should also support variable names with meta characters.

This feature is actually very similar to quoted symbols found in most Lisps (such as Racket).

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

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.