Broken example code: #14

Closed
opened 6 years ago by clozach · 1 comments
clozach commented 6 years ago (Migrated from github.com)

https://github.com/mbutterick/beautiful-racket/blob/master/beautiful-racket-lib/br/scribblings/br.scrbl

Unless I'm mistaken in reading the docs for define-macro, these two examples are not meant to include errors:

> (sandwich brie ham please)
eval:30:0: syntax-parse: literal is unbound in phase 0
(phase 0 relative to the enclosing module)
  at: sandwich
  in: (syntax-parse (syntax-case stx () (any (syntax any)))
#:literals (sandwich) #:datum-literals (please) ((sandwich
TOPPING FILLING please) (begin (syntax (format "I love ~a
with ~a." (quote FILLING) (quote TOPPING))))) (else
(raise-syntax-error (quote san...
> (sandwich banana bacon please)=
eval:30:0: syntax-parse: literal is unbound in phase 0
(phase 0 relative to the enclosing module)
  at: sandwich
  in: (syntax-parse (syntax-case stx () (any (syntax any)))
#:literals (sandwich) #:datum-literals (please) ((sandwich
TOPPING FILLING please) (begin (syntax (format "I love ~a
with ~a." (quote FILLING) (quote TOPPING))))) (else
(raise-syntax-error (quote san...
https://github.com/mbutterick/beautiful-racket/blob/master/beautiful-racket-lib/br/scribblings/br.scrbl Unless I'm mistaken in reading the docs for `define-macro`, these two examples are not meant to include errors: ``` > (sandwich brie ham please) eval:30:0: syntax-parse: literal is unbound in phase 0 (phase 0 relative to the enclosing module) at: sandwich in: (syntax-parse (syntax-case stx () (any (syntax any))) #:literals (sandwich) #:datum-literals (please) ((sandwich TOPPING FILLING please) (begin (syntax (format "I love ~a with ~a." (quote FILLING) (quote TOPPING))))) (else (raise-syntax-error (quote san... > (sandwich banana bacon please)= eval:30:0: syntax-parse: literal is unbound in phase 0 (phase 0 relative to the enclosing module) at: sandwich in: (syntax-parse (syntax-case stx () (any (syntax any))) #:literals (sandwich) #:datum-literals (please) ((sandwich TOPPING FILLING please) (begin (syntax (format "I love ~a with ~a." (quote FILLING) (quote TOPPING))))) (else (raise-syntax-error (quote san... ```
mbutterick commented 6 years ago (Migrated from github.com)

Thanks — that was indeed wrong.

Thanks — that was indeed wrong.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mbutterick/beautiful-racket#14
Loading…
There is no content yet.