Re: [racket] filtering syntax

2012-01-18 Thread Matthew Flatt
At Wed, 18 Jan 2012 16:53:14 +0100, Marijn wrote: > So after rewriting for syntax-case, this becomes the below, where I > have also inserted a call to internal-definition-context-seal which > was mentioned by the documentation as being required, but causes no > obvious problems when absent. Should

Re: [racket] filtering syntax

2012-01-18 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 18-01-12 13:30, Marijn wrote: > On 18-01-12 13:05, Veer Singh wrote: >> Add > >> (require (for-syntax syntax/parse)) > > Right, so after adding (require (for-syntax syntax/parse > syntax/free-vars)) it works, > > Marijn So after rewriting for s

Re: [racket] filtering syntax

2012-01-18 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 18-01-12 13:05, Veer Singh wrote: > Add > > (require (for-syntax syntax/parse)) Right, so after adding (require (for-syntax syntax/parse syntax/free-vars)) it works, Marijn -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.18 (GNU/Linux) Comment:

Re: [racket] filtering syntax

2012-01-18 Thread Veer Singh
Add (require (for-syntax syntax/parse)) or use syntax-case and wrap it in begin i.e (begin define id-lst .) On Wed, Jan 18, 2012 at 5:36 PM, Marijn wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 18-01-12 11:36, Veer Singh wrote: > > This seems to work (blind hack), > >

Re: [racket] filtering syntax

2012-01-18 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 18-01-12 11:36, Veer Singh wrote: > This seems to work (blind hack), Unfortunately it doesn't work: _: wildcard not allowed as an expression in: (_ ((id:id expr:expr ...) ...)) in line 3 of the following: > (define-syntax (depgraph stx) (syntax-p

Re: [racket] filtering syntax

2012-01-18 Thread Veer Singh
This seems to work (blind hack), I really don't know what syntax-local-make-definition-context and syntax-local-bind-syntaxes does I can only assume that they introduce some kind of bindings in particular context. (define-syntax (depgraph stx) (syntax-parse stx [(_ ((id:id expr:expr ...) ..

Re: [racket] filtering syntax

2012-01-18 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 17-01-12 16:14, Sam Tobin-Hochstadt wrote: > On Tue, Jan 17, 2012 at 4:06 AM, Marijn wrote: >> On 16-01-12 15:28, Sam Tobin-Hochstadt wrote: >>> On Mon, Jan 16, 2012 at 7:57 AM, Marijn >>> wrote: ((_ ((id rule) ...)) (with-syntax (((dep

Re: [racket] filtering syntax

2012-01-17 Thread Sam Tobin-Hochstadt
On Tue, Jan 17, 2012 at 4:06 AM, Marijn wrote: > On 16-01-12 15:28, Sam Tobin-Hochstadt wrote: >> On Mon, Jan 16, 2012 at 7:57 AM, Marijn wrote: >>> >>> ((_ ((id rule) ...)) (with-syntax (((dep ...) (free-vars (expand >>> #'(rule ...) >> >> You need to use `local-expand', not `expand', here.

Re: [racket] filtering syntax

2012-01-17 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 16-01-12 15:28, Sam Tobin-Hochstadt wrote: > On Mon, Jan 16, 2012 at 7:57 AM, Marijn wrote: >> >> ((_ ((id rule) ...)) (with-syntax (((dep ...) (free-vars (expand >> #'(rule ...) > > You need to use `local-expand', not `expand', here. Probab

Re: [racket] filtering syntax

2012-01-16 Thread Sam Tobin-Hochstadt
On Mon, Jan 16, 2012 at 7:57 AM, Marijn wrote: > >    ((_ ((id rule) ...)) >     (with-syntax (((dep ...) (free-vars (expand #'(rule ...) You need to use `local-expand', not `expand', here. Probably like this: (local-expand #'(rule ...) 'expression '()) -- sam th sa...@ccs.neu.edu

Re: [racket] filtering syntax

2012-01-16 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 13-01-12 15:52, Sam Tobin-Hochstadt wrote: > On Fri, Jan 13, 2012 at 9:23 AM, Matthias Felleisen > wrote: >> compute the free variables with a simple recursive pass over core >> syntax, > > Note that there's code to do this here: > http://pre.ra

Re: [racket] filtering syntax

2012-01-16 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 13-01-12 16:32, Matthias Felleisen wrote: > > On Jan 13, 2012, at 10:20 AM, Marijn wrote: > >> >> Right, b would be a constant, namely the function that returns >> the value of a. > > > a is assignable so b is constant only between 'set! messag

Re: [racket] filtering syntax

2012-01-13 Thread Matthias Felleisen
On Jan 13, 2012, at 10:20 AM, Marijn wrote: > > Right, b would be a constant, namely the function that returns the > value of a. a is assignable so b is constant only between 'set! messages Racket Users list: http://lists.racket-lang.org/users

Re: [racket] filtering syntax

2012-01-13 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 13-01-12 15:23, Matthias Felleisen wrote: > > On Jan 13, 2012, at 8:40 AM, Marijn wrote: > >> My question is how one determines the dependencies from the above >> code. The result for the above would be something like: >> >> ((a) (b a) (c a b) (d

Re: [racket] filtering syntax

2012-01-13 Thread Sam Tobin-Hochstadt
On Fri, Jan 13, 2012 at 9:23 AM, Matthias Felleisen wrote: > compute the free variables with a simple recursive pass over core syntax, Note that there's code to do this here: http://pre.racket-lang.org/docs/html/syntax/syntax-helpers.html -- sam th sa...@ccs.neu.edu Racke

Re: [racket] filtering syntax

2012-01-13 Thread Matthias Felleisen
On Jan 13, 2012, at 8:40 AM, Marijn wrote: > My question is how one determines the > dependencies from the above code. The result for the above would be > something like: > > ((a) >(b a) >(c a b) >(d c)) If model allows arbitrary Racket code on the right-hand side, you locally e