On Fri, Oct 28, 2016 at 1:51 PM, Jay McCarthy <[email protected]> wrote:
> On Fri, Oct 28, 2016 at 5:29 AM, Laurent <[email protected]> wrote: > > This new form, `(define-module+ ADD-TO-X X L)`, defines the module X > as a `module` with L as the lang AND defines a macro that works just > like module+ (except you don't give it a name) called ADD-TO-X that > adds stuff to X's body. So it is called `define-module+` because it > defines something like `module+` as its main job. > Yes, ok. Let me refine my post then: 'module+' creates the module on the first instance, but then adds to it on the next instances. So you could imagine that instead of creating a macro duck+, you could also use 'module+ duck' instead (maybe), thus avoiding yet another form. The 'duck+' form is just syntactic salt on top of the main idea which is specifying the language and sealing the module explicitly so as to be required later. > It would be possible to change `module+` to specify the > language in the way you suggest, except it's easier to imagine making > a mistake by having the keyword multiple times or inconsistently, etc. > The multiple occurrences of the keyword can easily be fixed with '~once' in 'syntax-parse' I suppose. Not sure what you mean about inconsistency. Then, if successful, I guess your versions of module+ and module* could replace the old ones. > > This means we can use #:declared on a module+, but I don't know how it > works. > > Yes. You can already do that with my implementation. It "seals" the > module and refuses to allow any more body syntax. > Nice! Laurent -- You received this message because you are subscribed to the Google Groups "Racket Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-dev/CABNTSaEwj%2Bp5v665DsF%3DKE43dMG-6r1_hO82-0Gre7V9ci50uw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
