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 <[email protected]> wrote: > -----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-parse stx [(_ ((id:id > > expr:expr ...) ...)) > > > > (define id-lst (syntax->list #'(id ...))) (define ctx > > (syntax-local-make-definition-context)) (syntax-local-bind-syntaxes > > id-lst #f ctx) (with-syntax ([p #'((lambda () expr ...) ...)]) > > (define p-lst (syntax->list #'p)) (define vars (map (lambda (e) > > (free-vars (local-expand e 'expression '() ctx))) p-lst)) > > (with-syntax ([((f ...) ...) vars]) #''((id (f ...)) ...)))])) > > > > > > (define simple-arith (depgraph ((a #f) (b (* 3 a)) (c (+ 5 a b)) (d > > (let ((a 9)) (- c a))) ))) > > > > simple-arith ;((a ()) (b (a)) (c (b a)) (d (c))) > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2.0.18 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAk8WtcAACgkQp/VmCx0OL2xvBQCgxxM7UrjQqXhK/djusC9apPey > CrYAn19TFKmxRsTOnzVZoknhdrY3BuJC > =6bty > -----END PGP SIGNATURE----- >
____________________ Racket Users list: http://lists.racket-lang.org/users

