-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
better printing and syntax for strange symbols #7188
Comments
My failed attempt at writing code to identify identifiers is here: https://github.com/JuliaStats/DataFrames.jl/blob/master/src/other/utils.jl#L17 |
All the code to do this should be part of the Lexer / Tokenizer in JuliaParser.jl. |
This is remarkably hard to even figure out how to change. The display code is such a tangled web these days; it really needs some serious cleaning. |
The lisp approach would be to make
would actually initialize a variable called Therefore I'd propose a custom string literal, |
I like the |
I think I'd prefer |
I agree: I don't think one should allow crazy identifiers, just allow construction of symbols that are not valid identifiers. |
In general, we need to export a number of things from the Scheme parser: a predicate for testing whether a string is a valid identifier, the list of binary operators and their precedence, and probably some other things. That said, I'm extremely skeptical that this should block 0.3. |
print invalid-identifier symbols as symbol("..."); fixes #7188
We do a lousy job of printing symbols that aren't valid identifiers:
This is relatively easy to fix by printing symbols that aren't valid identifiers like this:
Speaking of which, do we have an easy function for checking if a symbol is a valid identifier? That's become and increasingly tricky thing to decide.
We could also support a better input/output syntax for weird symbols:
:"foo bar "
. Using this syntax is ok since there's no point in quoting a string literal like that – it has the same effect as just writing"foo bar "
currently, so is effectively wasted syntax.This issue was spawned by these conversations:
The text was updated successfully, but these errors were encountered: