-
Notifications
You must be signed in to change notification settings - Fork 37
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
Eliminate the dollar sign hack #203
Eliminate the dollar sign hack #203
Conversation
README.md
Outdated
@@ -433,7 +433,7 @@ There are some special cases: | |||
|
|||
singleton constructr: `SCons` | |||
|
|||
symbols: `ConsSym0`, `ConsSym1` | |||
symbols: `:@#$%^%$#@$`, `:@#$%^%$#@$` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I didn't change conventions here! I checked, and it turns out the defunctionalization symbols for (:)
weren't actually named ConsSym0
and ConsSym1
at all, but rather (:$)
and (:$$)
. I just opted to update this reference to be correct here, since I happened to change what (:$)
and (:$$)
were named.
The downside to this is that now defunctionalization symbols are obscenely long and hard to remember. Perhaps we ought to provide a convenience function of type |
This diff is ugly. Is there an intermediate solution, something without quite so many symbols? Like, maybe 2-3 arbitrary symbols will be enough in practice. (Note that if someone wrote a normal identifier that happened to end in |
Indeed, I'm not claiming this will eliminate naming conflicts altogether (ultimately, we'd need something like #204 to work around that robustly), but it will certainly make it less likely. How about |
|
* Suffix symbol defun symbols with @#$%^%0@ * Eliminate the dollar-sign hack * ConsSym0 and ConsSym1 aren't actually things, update them * Use the suffix @#@ instead
singletons
currently special-cases a lot of operations for names that begin with$
. It has been the center of a spider's nest of bugs (see #29, #160 (comment), #172, and #197 for examples).This PR rips out the hack, and improves the situation surrounding defunctionalization symbols, which use
$
characters as suffixes. We now precede the defunctionalized$
s with the string@#$%^%$#@
(as suggested in #197 (comment)). This allows use to promote($)
and($!)
without any special-casing at all. Huzzah!