Re: [racket-users] Re: Readers and Namespaces

2017-08-18 Thread Shu-Hung You
If you are implementing a new language, this can be done by delegating the "=-to-let" work to the macro-expander and let the reader simply parenthesizing the input into s-expression form. In this approach, we don't need to worry about being hygienic in the reader since the actual work is done by

Re: [racket-users] Readers and Namespaces

2017-08-18 Thread Matthew Butterick
> On Aug 17, 2017, at 10:11 PM, Alexis King wrote: > > This is, for > better or for worse, currently a no-no in Racket — syntax objects > produced by a #lang’s reader are supposed to only have source locations > and syntax properties on them, not lexical context.

[racket-users] Requiring module beneath top level?

2017-08-18 Thread hiphish
Hello Racketeers, A while ago I announced my MessagePack library here and I mentioned that I was needing it for a client library for the Neovim text editor. Since then I have been writing this client library and now I'm at a point where I need help. Let me first give you some context: Neovim is

Re: [racket-users] Can a macro "return" a macro without expanding it?

2017-08-18 Thread Matthias Felleisen
> On Aug 18, 2017, at 6:41 PM, Matthew Butterick wrote: > > >> On Aug 18, 2017, at 2:28 AM, Sam Waxman > > wrote: >> >> If I have code like this, >> >> (define-syntax-rule (identity x) >> x) >> >> ((identity identity) 1)

Re: [racket-users] Requiring module beneath top level?

2017-08-18 Thread Jon Zeppieri
On Fri, Aug 18, 2017 at 7:08 PM, wrote: > > Here is an idea of what a plugin registration function could look like: > > (define (load-plugins paths) > ;; Process one plugin at a time > (define (load-plugin path) > ;; Add the path (or its stem) to the

Re: [racket-users] Can a macro "return" a macro without expanding it?

2017-08-18 Thread Matthew Butterick
> On Aug 18, 2017, at 2:28 AM, Sam Waxman wrote: > > If I have code like this, > > (define-syntax-rule (identity x) > x) > > ((identity identity) 1) > > Is there a simple way to change this so that ((identity identity) 1) actually > does expand into (identity 1) which

[racket-users] Can a macro "return" a macro without expanding it?

2017-08-18 Thread Sam Waxman
If I have code like this, (define-syntax-rule (identity x) -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more

[racket-users] Can a macro "return" a macro without expanding it?

2017-08-18 Thread Sam Waxman
If I have code like this, (define-syntax-rule (identity x) x) ((identity identity) 1) At phase 1, the (identity identity) will get transformed into identity. As macros expand outside in, however, this won't turn into (identity 1) like a function would, it will try expanding the identity

[racket-users] Seeking a graphviz like, diagramming language for Racket

2017-08-18 Thread Andrew Gwozdziewycz
Hi folks, I've been using graphviz for years for basic network architecture diagrams and things, mostly to avoid answering the question of "which annoying tool should I use?" Graphviz has limitations for the type of stuff I use it for, but I settle for it anyway, since it's a lot less frustrating

Re: [racket-users] Can a macro "return" a macro without expanding it?

2017-08-18 Thread Matthias Felleisen
> On Aug 18, 2017, at 9:44 AM, Sam Waxman wrote: > > On Friday, August 18, 2017 at 9:31:33 AM UTC-4, Matthias Felleisen wrote: >>> On Aug 18, 2017, at 5:28 AM, Sam Waxman wrote: >>> >>> If I have code like this, >>> >>> (define-syntax-rule (identity

Re: [racket-users] Can a macro "return" a macro without expanding it?

2017-08-18 Thread Sam Waxman
On Friday, August 18, 2017 at 10:14:10 AM UTC-4, Matthias Felleisen wrote: > On Aug 18, 2017, at 9:44 AM, Sam Waxman wrote: > > On Friday, August 18, 2017 at 9:31:33 AM UTC-4, Matthias Felleisen wrote: > On Aug 18, 2017, at 5:28 AM, Sam Waxman wrote: > >

Re: [racket-users] Re: Readers and Namespaces

2017-08-18 Thread gfb
Assuming the setup where you make a module syntax object and call strip-context on it, you can add a scope to all the user's identifiers after that so they're not considered “above” any of the language's identifiers. Make a function to do the marking: (define marker (make-syntax-introducer

Re: [racket-users] Can a macro "return" a macro without expanding it?

2017-08-18 Thread Matthias Felleisen
> On Aug 18, 2017, at 5:28 AM, Sam Waxman wrote: > > If I have code like this, > > (define-syntax-rule (identity x) > x) > > ((identity identity) 1) > > At phase 1, the (identity identity) will get transformed into identity. As > macros expand outside in, however,

Re: [racket-users] Can a macro "return" a macro without expanding it?

2017-08-18 Thread Sam Waxman
On Friday, August 18, 2017 at 9:31:33 AM UTC-4, Matthias Felleisen wrote: > > On Aug 18, 2017, at 5:28 AM, Sam Waxman wrote: > > > > If I have code like this, > > > > (define-syntax-rule (identity x) > > x) > > > > ((identity identity) 1) > > > > At phase 1, the