-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
change cond else behaviour #38
Comments
I agree with the first point, replacing fallthrough behavior (when there's no else and all the conditions are false) from void to error. There have been so many bugs written by myself and other people that would have been caught much sooner if an error were the default fallthrough behavior. However, I don't see any reason to change |
I don’t understand the rationale for |
I think the rationale is:
results in
locally, readers might assume that it will return |
I think that's acceptable because you can tell just by mousing over it in DrRacket that Plus the programmer presumably meant to override the meaning of |
The idea is that an |
Perhaps this should be separated into two issues. The discussion on behavior/runtime-semantics for point (1) will be different from the discussion on syntax for point (2) |
So @spdegabrielle should we remove point (1) and move discussion on that to #39? Most of the discussion in comments seems to be on point (2) here |
The way I remember hearing this explained recently is that most DSLs should look up transformer bindings, and if it doesn't make sense for them to do so, then they're really not dealing with the meanings of symbols and they're instead dealing with names. Users pass in symbols when they intend to pass in their meanings (or to bind them to new meanings), and they pass in keywords when they intend for the name to matter. In my opinion, the user really intends to pass in keywords by meaning too, and the root cause is a bit different. When a DSL is simple enough that it doesn't even have recursive cases in its syntax, that leads to a couple of consequences:
These are roughly the conditions where Racket uses keywords instead of symbols. If it were up to me, I'd like to go with parentheses and an extension DSL anyway, just to set the right example so people don't paint themselves into a corner by starting the keyword way and then realizing their DSL has grown too big to sustain it. But maybe that means people who are trying to learn what |
change cond else behaviour;
cond
's default else-is-void clause and replace with a default else-is-error.cond
(andmatch
) to use#:else
instead ofelse
.Author unknown
Issue creation suggested by @gus-massa in from Wishlist of backwards incompatible things for a future Racket2. #33
The text was updated successfully, but these errors were encountered: