greghendershott / rackjure

Provide a few Clojure-inspired ideas in Racket. Where Racket and Clojure conflict, prefer Racket.
BSD 2-Clause "Simplified" License
236 stars 17 forks source link

definition of `=` in `rackjure/egal` submodule #49

Closed mflatt closed 9 years ago

mflatt commented 9 years ago

For some reason, the current version of Racket allows

(module+ test
  (require racket)
  (define = ....))

but the set-of-scopes macro expander rejects this as defining an identifier that was imported. That causes rackjure/egal to not compile, since it has the above pattern (spread over two module+s).

greghendershott commented 9 years ago

I'll change that.

But out of curiosity:

For some reason, the current version of Racket allows

Isn't that because bindings from a module-lang's can be shadowed/redefined...

(module id module-path form ...) ... The module-path form must be as for require, and it supplies the initial bindings for the body forms. That is, it is treated like a (require module-path) prefix before the forms, except that the bindings introduced by module-path can be shadowed by definitions and requires in the module body forms.

...and = is coming from the module-lang racket/base -- therefore it is supposed to work?

greghendershott commented 9 years ago

Oh wait, do you mean = also comes from the (require racket)? Therefore I should use except-in?

mflatt commented 9 years ago

Yes, it's the = from (require racket) that should create a conflict.