-
Notifications
You must be signed in to change notification settings - Fork 119
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
Curly braces and square brackets #29
Comments
Square brackets are already taken for vectors. If I add curly braces, they will have to match (i.e. Femtolisp allows { and } as identifier characters, which is arguably a bug and I think should be disabled first of all. Then there are two further problems:
So I think what we can do is (1) make {} an error, (2) make [] work like parens (with correct matching of course). |
@FemtoEmacs I can't seem to find the email you refer to; best to post the rationale here. |
The email and the rationale was written by Vernon Sipple, the person who is 2016-10-19 15:17 GMT-02:00 Jeff Bezanson [email protected]:
|
Closing as dup of #30. |
I am currently writing a tutorial on femtolisp. I would appreciate if the owner of this site and developer of femtolisp modify the compiler, so that curly braces be synonymous for parentheses. The rationale for the change was given in an email to Jeff. The change entails the following modification in the read.c file:
static inline int symchar(char c)
{
static char *special = "()[]{}'";`,| \f\n\r\t\v";
return !strchr(special, c);
}
/* Recognize the tokens */
if ((c == '(') || (c == '{')) {
toktype = TOK_OPEN;
}
else if ((c == ')') || (c == '}') ) {
toktype = TOK_CLOSE;
}
The text was updated successfully, but these errors were encountered: