-
Notifications
You must be signed in to change notification settings - Fork 3
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
check for duplicate definitions #3
Comments
|
Yes, in general, because otherwise people try to use this "feature" to create weird programs that are not actually interesting SMoL programs (this is an artifact of the Scheme/Racket definitions window semantics, not of the standard model). My ultimate goal here is to keep students focused on SMoL, and not get distracted by Racket-permitted artifacts. The excessively lightweight embedding into Racket means Racket percolates too much, and needs to be blocked more. |
I understand that you want to keep students focused on SMoL. But I can't see how Racket differs from other SMoL languages. AFAIK, Python, Java, and OCaml all allow shadowing, same in |
The problem is that the "top-level scope" is screwed up in so many languages. I don't even think there is a "standard model" — each one is messed up somewhat differently. (And it gets even more complicated when you get to the REPL.) Given that there is no SMoL for this, I would rather we have a simple and easy-to-understand semantics. That both avoids picking one non-trivial solution out of many solutions where none is standard, AND keeps students from getting caught up in knots. It seems to me that rejecting programs with duplicate definitions might be the simplest of those solutions. But if you want to argue for a different semantics, go ahead! |
defvar
anddeffun
should probably check for and reject duplicate definitions in some meaningful way. (Though what exactly is a "duplicate" definition? Perhaps we need a list of prior top-level definitions? What about inside nested scopes?)The text was updated successfully, but these errors were encountered: