> 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
> 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)
(
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
(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
4 matches
Mail list logo