Re: [racket-users] macros within expressions.

2016-04-06 Thread Alex Knauth
> On Apr 6, 2016, at 8:29 PM, Matthew Butterick wrote: > So you can repair your macro by matching to `y-coord` as a pattern: > > ;;; > > #lang racket > (require rackunit) > > (define-syntax y-coord > (syntax-id-rules () > [y-coord point-y])) > > (struct point (x y)) > (defi

Re: [racket-users] macros within expressions.

2016-04-06 Thread Matthew Butterick
> Expanding `y-coord` by itself leads to the error. I've tripped over this, so just to elaborate slightly. `syntax-id-rules` will work, but your current macro: ;;; (define-syntax y-coord (syntax-id-rules (map) [(map y-coord lst) (map (lambda (p) (

Re: [racket-users] macros within expressions.

2016-04-06 Thread Vincent St-Amour
Adding `(define y-coord points-y)` should make the original example work as-is. Vincent On Wed, 06 Apr 2016 15:45:56 -0500, Daniel Prager wrote: > > (map point-y points) gives the expected result without recourse to a > macro. > > Or is y-coord intended as a simplified example of something els

Re: [racket-users] macros within expressions.

2016-04-06 Thread Daniel Prager
(map point-y points) gives the expected result without recourse to a macro. Or is y-coord intended as a simplified example of something else? Dan -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving