Open SuzanneSoy opened 7 years ago
I don't think you really want an unhygienic version. Would it be better if you could specify which lambda
identifier it used?
In most cases, this would be sufficient.
However, there can be submodules with different languages (as an example, the scribble/lp2
program below). If the lambda
identifier to use can be specified via a for-syntax parameter or something like that, which takes effect only within the module, then it should be fine. There would still be issues if it is specified for the whole file, e.g. with #lang afl #:lambda-from racket/base mylang
.
#lang afl scribble/lp2
@; => lambda from racket/base, as we are executing scribble code:
@(apply itemlist (map #λ(item "Hello" % "!") (range 5)))
@chunk[<*>
(module main type-expander/lang
;; => lambda from type-expander
(#λ(cons 0 %) '(1 2 3)))]
Okay. Now I see an unhygienic version does make sense as an opt-in.
Hello!
I'm using
afl
withtyped/racket
and mytype-expander
library.The
type-expander
library works by overridingdefine
,lambda
and so on. Due toafl
's hygiene,#λ(…)
expands to a use orlambda
fromracket/base
, not the intendedlambda
from thetype-expander
library. Fortunately, since there are no argument or return types to expand within#λ(…)
, the difference does not matter, but I suppose that in other cases it could matter.Would it make sense to also have an unhygienic version of afl directly within this package?
I needed a unhygienic version, to circumvent an incompatibility between
afl
and a modified version ofscribble/lp2
that I use, the incompatibility is most likely on my side, but on the short term dropping hygiene seemed to do the trick, and I'll get back to my issue later. I have therefore already created theaful
package, which provides#lang aful
(exactly the same asafl
) and#lang aful/unhygienic
(unhygienic version).If you think it's best to merge these changes in here, then I can open a PR, otherwise I can leave
aful
as a separate package. You can see the changes here https://github.com/AlexKnauth/afl/compare/master...jsmaniac:unhygienic if you want (this diff also includes some changes to render correctly#λ
when it appears in scribble documents, using a patched version of scribble).Regards, Georges Dupéron