You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow multi-character identifiers and special symbols as identifiers for definitions #42
Allowing multicharacter variable names has been one of the more annoying problems that I haven't quite figured out yet-- how do we deal with the ambiguity of saying SUCC being one variable, vs. ((SU)C)C, while still keeping the metalanguage relatively small and succinct?
Options are:
let the lexer look up to see if a symbol SUCC exists in the execution context before lexing as (((S)U)C)C
require whitespace around single letter variable names
something else??
I don't personally like either of those two options, but I'm leaning towards the second one, it seems to be done half the time anyways, or whenever ambiguity pops up.
As for certain special characters, we can just whitelist those.
What about a special case where words starting with a capital letter are tokenized as a single identifier? SUCC, Succ, etc. It seem like people almost never use uppercase letters under lambdas.
I'm reopening this because I'm addressing the idea of special symbols as identifiers. This should be made easier by: #65 because now we no longer have the restriction that eta is a privileged character that the user can't input.
Activity
evinism commentedon Jun 8, 2017
Allowing multicharacter variable names has been one of the more annoying problems that I haven't quite figured out yet-- how do we deal with the ambiguity of saying
SUCCbeing one variable, vs.((SU)C)C, while still keeping the metalanguage relatively small and succinct?Options are:
SUCCexists in the execution context before lexing as(((S)U)C)CI don't personally like either of those two options, but I'm leaning towards the second one, it seems to be done half the time anyways, or whenever ambiguity pops up.
As for certain special characters, we can just whitelist those.
anton-trunov commentedon Jun 8, 2017
What about a special case where words starting with a capital letter are tokenized as a single identifier?
SUCC,Succ, etc. It seem like people almost never use uppercase letters under lambdas.evinism commentedon Oct 19, 2017
implemented in #55, merging after green
evinism commentedon Jan 13, 2019
I'm reopening this because I'm addressing the idea of special symbols as identifiers. This should be made easier by: #65 because now we no longer have the restriction that eta is a privileged character that the user can't input.
evinism commentedon Jan 16, 2019
implemented here #71