Re: [racket-dev] try the new macro expander

2015-07-25 Thread Alexis King
Oh wow, thanks for the prompt update. I was in the process of trying to pick my way through the C code to figure out how I might be able to implement it myself, but I must admit I wasn’t getting anywhere fast. ;) > On Jul 25, 2015, at 1:40 PM, Matthew Flatt wrote: > > Yes, those uses rely on t

Re: [racket-dev] try the new macro expander

2015-07-25 Thread Matthew Flatt
Yes, those uses rely on the resulting syntax not being `syntax-original?`. I've pushed the change to `make-syntax-introducer`. Pass a true argument to `make-syntax-introducer` to create a scope that acts like a use-site scope (no effect on `syntax-original?`) instead of a macro-introduction scope.

Re: [racket-dev] try the new macro expander

2015-07-25 Thread Alexander D. Knauth
Is it relying on the resulting syntax not being `syntax-original?` though? And even if it is, would the input syntax not be original most of the time anyway? On Jul 25, 2015, at 11:50 AM, Matthew Flatt wrote: > I think it would not matter in some cases. The original intent, though, > was to cre

Re: [racket-dev] try the new macro expander

2015-07-25 Thread Matthew Flatt
I think it would not matter in some cases. The original intent, though, was to create a scope that's like a macro-introduction scope --- where the result should not be considered part of the original program, and the added scope may be the only indication of that. A grep through some sources shows

Re: [racket-dev] try the new macro expander

2015-07-25 Thread Alexander D. Knauth
Is there any reason not to have `make-syntax-introducer` functions preserve `syntax-original?`-ness whenever it's given something `syntax-original?` ? On Jul 25, 2015, at 9:03 AM, Matthew Flatt wrote: > I think the change to `make-syntax-introducer` is straightforward, and > it still seems like

Re: [racket-dev] try the new macro expander

2015-07-25 Thread Matthew Flatt
I think the change to `make-syntax-introducer` is straightforward, and it still seems like the right idea, but I haven't gotten there, yet. (I hope to catch up on many things next week.) At Fri, 24 Jul 2015 22:32:55 -0700, Alexis King wrote: > > That makes sense in retrospect. Adding an extra scop

Re: [racket-dev] try the new macro expander

2015-07-24 Thread Alexis King
> That makes sense in retrospect. Adding an extra scope makes > `syntax-original?` produce #f for everything in whole module, and that > makes DrRacket ignore the identifiers. > > I think `make-syntax-introducer` should probably accept an optional > argument to specify that the new scope should *n

Re: [racket-dev] try the new macro expander

2015-07-20 Thread Robby Findler
On Mon, Jul 20, 2015 at 9:08 AM, Alexander D. Knauth wrote: > > On Jul 20, 2015, at 9:23 AM, Matthew Flatt wrote: > >> At Mon, 20 Jul 2015 08:20:32 -0500, Robby Findler wrote: >>> On Mon, Jul 20, 2015 at 8:16 AM, Matthew Flatt wrote: At Sun, 19 Jul 2015 15:46:07 -0700, Alexis King wrote: >>

Re: [racket-dev] try the new macro expander

2015-07-20 Thread Robby Findler
On Mon, Jul 20, 2015 at 8:49 AM, Gustavo Massaccesi wrote: > Slightly off-topic: I didn't notice 'original-for-check-syntax. A few > weeks ago I had problems with a missing arrows in DrRacket, and I > searched for 'disappeared-use and I got > http://docs.racket-lang.org/reference/stxprops.html?q=d

Re: [racket-dev] try the new macro expander

2015-07-20 Thread Alexander D. Knauth
On Jul 20, 2015, at 9:23 AM, Matthew Flatt wrote: > At Mon, 20 Jul 2015 08:20:32 -0500, Robby Findler wrote: >> On Mon, Jul 20, 2015 at 8:16 AM, Matthew Flatt wrote: >>> At Sun, 19 Jul 2015 15:46:07 -0700, Alexis King wrote: One more thing: introducing a new scope with make-syntax-introduc

Re: [racket-dev] try the new macro expander

2015-07-20 Thread Gustavo Massaccesi
Slightly off-topic: I didn't notice 'original-for-check-syntax. A few weeks ago I had problems with a missing arrows in DrRacket, and I searched for 'disappeared-use and I got http://docs.racket-lang.org/reference/stxprops.html?q=disappeared-use#%28idx._%28gentag._188._%28lib._scribblings%2Freferen

Re: [racket-dev] try the new macro expander

2015-07-20 Thread Matthew Flatt
At Mon, 20 Jul 2015 08:20:32 -0500, Robby Findler wrote: > On Mon, Jul 20, 2015 at 8:16 AM, Matthew Flatt wrote: > > At Sun, 19 Jul 2015 15:46:07 -0700, Alexis King wrote: > >> One more thing: introducing a new scope with make-syntax-introducer seems > >> to > >> break DrRacket’s Check Syntax arr

Re: [racket-dev] try the new macro expander

2015-07-20 Thread Robby Findler
On Mon, Jul 20, 2015 at 8:16 AM, Matthew Flatt wrote: > At Sun, 19 Jul 2015 15:46:07 -0700, Alexis King wrote: >> One more thing: introducing a new scope with make-syntax-introducer seems to >> break DrRacket’s Check Syntax arrows for the whole module. > > That makes sense in retrospect. Adding an

Re: [racket-dev] try the new macro expander

2015-07-20 Thread Matthew Flatt
At Sun, 19 Jul 2015 15:46:07 -0700, Alexis King wrote: > One more thing: introducing a new scope with make-syntax-introducer seems to > break DrRacket’s Check Syntax arrows for the whole module. That makes sense in retrospect. Adding an extra scope makes `syntax-original?` produce #f for everythi

Re: [racket-dev] try the new macro expander

2015-07-20 Thread Matthew Flatt
At Sun, 19 Jul 2015 12:21:02 -0700, Alexis King wrote: > This works: > >#lang curly-fn racket >(begin-for-syntax > (#{+} 1 2 3)) > > This doesn’t: > >#lang curly-fn racket >(require (for-meta 2 racket/base)) >(begin-for-syntax > (begin-for-syntax >(#{+} 1 2

Re: [racket-dev] try the new macro expander

2015-07-19 Thread Alexis King
One more thing: introducing a new scope with make-syntax-introducer seems to break DrRacket’s Check Syntax arrows for the whole module. I don’t understand exactly how DrRacket’s arrows work, but my preliminary debugging in the macro stepper has left me a little confused. Whether I’m using curly

Re: [racket-dev] try the new macro expander

2015-07-19 Thread Alexis King
I have been testing mostly using a combination of DrRacket and `raco test`. However, with that begin-for-syntax bug fixed, I’ve determined what seems to be the problem (and is reminiscent of a similar problem in the previous version). This works: #lang curly-fn racket (begin-for-syntax

Re: [racket-dev] try the new macro expander

2015-07-19 Thread Alexis King
I’ve just taken the time to reimplement how my curly-fn package handles the transformation in an attempt to make it a little less unwieldy. Specifically, the transformation itself is now done via macro expansion rather than being performed at read-time. This means that the curly brace syntax its

Re: [racket-dev] try the new macro expander

2015-07-18 Thread Alexander D. Knauth
On Jul 18, 2015, at 5:31 PM, Matthew Flatt wrote: > At Sat, 9 May 2015 06:59:53 -0600, Matthew Flatt wrote: >> At Thu, 16 Apr 2015 17:39:50 -0400, "Alexander D. Knauth" wrote: >>> >>> On Apr 16, 2015, at 8:17 AM, Matthew Flatt wrote: >>> I don't think a "hygienic" reader extension works

Re: [racket-dev] try the new macro expander

2015-07-18 Thread Matthew Flatt
At Sat, 9 May 2015 06:59:53 -0600, Matthew Flatt wrote: > At Thu, 16 Apr 2015 17:39:50 -0400, "Alexander D. Knauth" wrote: > > > > On Apr 16, 2015, at 8:17 AM, Matthew Flatt wrote: > > > > > I don't think a "hygienic" reader extension works in the old expander, > > > either. The `lambda` produce

Re: [racket-dev] try the new macro expander

2015-05-10 Thread Alexander D. Knauth
On May 9, 2015, at 11:59 AM, Matthew Flatt wrote: > At Sat, 9 May 2015 10:10:12 -0400, "Alexander D. Knauth" wrote: >> >> On May 9, 2015, at 8:59 AM, Matthew Flatt wrote: >> >>> Yes, with the current expander, adding a fresh mark on the >>> reader-introduced identifiers makes them impossible

Re: [racket-dev] try the new macro expander

2015-05-09 Thread Matthew Flatt
At Sat, 9 May 2015 10:10:12 -0400, "Alexander D. Knauth" wrote: > > On May 9, 2015, at 8:59 AM, Matthew Flatt wrote: > > > Yes, with the current expander, adding a fresh mark on the > > reader-introduced identifiers makes them impossible to bind (except by > > picking apart the form produced by

Re: [racket-dev] try the new macro expander

2015-05-09 Thread Alexander D. Knauth
On May 9, 2015, at 8:59 AM, Matthew Flatt wrote: > Yes, with the current expander, adding a fresh mark on the > reader-introduced identifiers makes them impossible to bind (except by > picking apart the form produced by `#λ...` to extract the special > identifiers). > > Although that strategy d

Re: [racket-dev] try the new macro expander

2015-05-09 Thread Matthew Flatt
At Thu, 16 Apr 2015 17:39:50 -0400, "Alexander D. Knauth" wrote: > > On Apr 16, 2015, at 8:17 AM, Matthew Flatt wrote: > > > I don't think a "hygienic" reader extension works in the old expander, > > either. The `lambda` produced by the `afl` or `rackjure` reader doesn't > > reliably refer to th

RE: [racket-dev] try the new macro expander

2015-04-19 Thread Jos Koot
: [racket-dev] try the new macro expander Just for fun. Don't try this at home: #lang racket (define-syntax-rule (quasiquote x) (reverse 'x)) `(1 2 3 4) Gustavo -- You received this message because you are subscribed to the Google Groups "Racket Developers" group. To unsubscribe

RE: [racket-dev] try the new macro expander

2015-04-19 Thread Jos Koot
ted. > So what is the problem? > Jos Koot > > -Original Message- > From: gus.ma...@gmail.com [mailto:gus.ma...@gmail.com] On Behalf Of Gustavo > Massaccesi > Sent: jueves, 16 de abril de 2015 21:59 > To: Alexander D. Knauth > Cc: Matthew Flatt; Racket Devs > Subject

Re: [racket-dev] try the new macro expander

2015-04-16 Thread Alexander D. Knauth
On Apr 16, 2015, at 8:17 AM, Matthew Flatt wrote: > I don't think a "hygienic" reader extension works in the old expander, > either. The `lambda` produced by the `afl` or `rackjure` reader doesn't > reliably refer to the `lambda` from `racket/base`, because a local > binding for `lambda` capture

Re: [racket-dev] try the new macro expander

2015-04-16 Thread Alexander D. Knauth
On Apr 16, 2015, at 5:01 PM, Jos Koot wrote: > But: > > (define quasiquote list) > (car '`x) ; -> quasiquote as well, which is not obvious. > > Racket has become very far in hygienic macros. > Is is time to think about hygienic read-tables too? > I have no idea how to acccomplish that. Sorry.

Re: [racket-dev] try the new macro expander

2015-04-16 Thread Robby Findler
On Thu, Apr 16, 2015 at 2:17 PM, Alexander D. Knauth wrote: > Okay, but I was hoping otherwise. If all the problems were solved then we wouldn't have anything to do, right?! Maybe this one is for you. :) Robby -- You received this message because you are subscribed to the Google Groups "Rack

Re: [racket-dev] try the new macro expander

2015-04-16 Thread Alexander D. Knauth
> Jos Koot > > -Original Message- > From: gus.ma...@gmail.com [mailto:gus.ma...@gmail.com] On Behalf Of Gustavo > Massaccesi > Sent: jueves, 16 de abril de 2015 21:59 > To: Alexander D. Knauth > Cc: Matthew Flatt; Racket Devs > Subject: Re: [racket-dev] try th

Re: [racket-dev] try the new macro expander

2015-04-16 Thread Gustavo Massaccesi
Just for fun. Don't try this at home: #lang racket (define-syntax-rule (quasiquote x) (reverse 'x)) `(1 2 3 4) Gustavo -- 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

Re: [racket-dev] try the new macro expander

2015-04-16 Thread Alexander D. Knauth
On Apr 16, 2015, at 8:17 AM, Matthew Flatt wrote: > I don't think a "hygienic" reader extension works in the old expander, > either. The `lambda` produced by the `afl` or `rackjure` reader doesn't > reliably refer to the `lambda` from `racket/base`, because a local > binding for `lambda` capture

Re: [racket-dev] try the new macro expander

2015-04-16 Thread Matthew Flatt
At Wed, 15 Apr 2015 17:43:42 -0400, "Alexander D. Knauth" wrote: > > On Apr 13, 2015, at 8:40 AM, Matthew Flatt wrote: > > > Most packages build ok using the above snapshot: > > > > http://next-pkg-build.racket-lang.org.s3-website-us-west-2.amazonaws.com/ > > > > Several failures are "ambiguou

Re: [racket-dev] try the new macro expander

2015-04-15 Thread Alexander D. Knauth
On Apr 13, 2015, at 8:40 AM, Matthew Flatt wrote: > Most packages build ok using the above snapshot: > > http://next-pkg-build.racket-lang.org.s3-website-us-west-2.amazonaws.com/ > > Several failures are "ambiguous binding" errors. That error usually > indicates an unavoidable incompatibility

Re: [racket-dev] try the new macro expander

2015-04-15 Thread Anthony Carrico
On 04/13/2015 08:40 AM, Matthew Flatt wrote: > I've also updated the write-up at > > http://www.cs.utah.edu/~mflatt/scope-sets-4/ >From scope-sets-4: > In a macro-extensible language, expanding a use of a macro creates a > new scope in the same way that a binding form creates a new scope. > Start

Re: [racket-dev] try the new macro expander

2015-04-13 Thread Jens Axel Søgaard
2015-04-13 14:40 GMT+02:00 Matthew Flatt : > The new macro expander is ready for you to try: ... > * A macro that uses `syntax-local-get-shadower` like will have to be >revised, and it should be revised to avoid that function. A macro >that uses `syntax-local-make-delta-introducer` defini

Re: [racket-dev] try the new macro expander

2015-04-13 Thread Matthew Flatt
I see that the `declare` macro is using `syntax-local-get-shadower` as a way of storing information in the compile-time environment. The `syntax-local-get-shadower` function is still the only primitive to provide that functionality. It's an awkward primitive, and I considered replacing it with a pr

[racket-dev] try the new macro expander

2015-04-13 Thread Matthew Flatt
The new macro expander is ready for you to try: http://www.cs.utah.edu/~mflatt/tmp/scope-snapshot/ What you should expect: * If your library has no macros, or if it uses only pattern-matching macros that don't expand to submodules or units, then it should work with the new expander with