Re: [racket-users] how to match unbound identifier as literal in `syntax-parse`?

2018-04-03 Thread Matthew Butterick
> On Apr 3, 2018, at 4:37 AM, Ryan Culpepper wrote: > > Here's one way: > > (~and z:id > (~fail #:unless (free-identifier=? #'z #'zeta) > "expected the identifier `zeta`")) > > Another way is to make a syntax class (either specifically for `zeta` or >

Re: [racket-users] let-syntax example?

2018-04-03 Thread Alex Knauth
> On Apr 3, 2018, at 2:31 PM, Kevin Forchione wrote: > > Hi Guys, > Does anyone have an analogous example for let-syntax to something as simple > as this? > > (let ([a 3]) a) > > Something like…. > > (let-syntax ([a 3]) ….) > > At which point I’m stumped as

Re: [racket-users] let-syntax example?

2018-04-03 Thread David Storrs
On Tue, Apr 3, 2018 at 3:02 PM, Shu-Hung You wrote: > Hi Keven, > > Here's an example: > > #lang racket > (let-syntax ([a (lambda (stx) >(printf "expansion time: stx = ~a\n" stx) >#'3) ]) > a) > >

Re: [racket-users] let-syntax example?

2018-04-03 Thread Shu-Hung You
Hi Keven, Here's an example: #lang racket (let-syntax ([a (lambda (stx) (printf "expansion time: stx = ~a\n" stx) #'3) ]) a) However, I would suggest to start at least from syntax objects and macro transformers in the guide and use

[racket-users] let-syntax example?

2018-04-03 Thread Kevin Forchione
Hi Guys, Does anyone have an analogous example for let-syntax to something as simple as this? (let ([a 3]) a) Something like…. (let-syntax ([a 3]) ….) At which point I’m stumped as to what expression in the body would return 3. There are no examples in the Reference.

Re: [racket-users] how to match unbound identifier as literal in `syntax-parse`?

2018-04-03 Thread Ryan Culpepper
Here's one way: (~and z:id (~fail #:unless (free-identifier=? #'z #'zeta) "expected the identifier `zeta`")) Another way is to make a syntax class (either specifically for `zeta` or parameterized by the identifier) that does the same check. Ryan On 4/3/18 8:33 AM,

Re: [racket-users] Why is there a space in the path to the Racket application on MacOSX?

2018-04-03 Thread Philip McGrath
One way the student languages from HtDP are different from most Racket DSLs and langs is that, in the service of regularity and nice error messages, they take away many convenient and powerful features of the full Racket language. There is not really an "escape hatch" into full Racket, other than

[racket-users] how to match unbound identifier as literal in `syntax-parse`?

2018-04-03 Thread Matthew Butterick
Consider the difference in results below. How would I persuade `syntax-parse` to match literal identifiers in the `free-identifier=?` sense that `syntax-case` does? (and thereby allow unbound identifiers to be compared also) IIUC, `#:literals` is too strict, as it insists that every listed