Thank you for your comment

Beau­tiful Racket / racket school 2019

  1. (with-syntax ([PT parse-tree])
      #'(module winner taco-victory
          (display (apply string PT)))
    1
    2
    3
    (with-syntax ([PT parse-tree])
      #'(module winner taco-victory
          (display (apply string PT)))
    
    copy to clipboard
    #'(taco-program (taco-leaf (not-a-taco) (taco)))
    1
    #'(taco-program (taco-leaf (not-a-taco) (taco)))
    
    copy to clipboard
    #'(module winner taco-victory
        (display (apply string (taco-program (taco-leaf (not-a-taco) (taco))))))
    1
    2
    #'(module winner taco-victory
        (display (apply string (taco-program (taco-leaf (not-a-taco) (taco))))))
    
    copy to clipboard
taco-victory/test.rkt
#lang taco-victory
##$%#$%#$#$#$$##$%#$%#$#$#$$##$%#$#$#$%#$$##$#$#$%#$%%$#%#$%#$#$%%$##$#$%%#$%%$##$#$%%#$%%$#%%%%#$%%$##$#$#$#$#$%#$$#%%%#$%%%$#%%%%#$%%$##$%#$#$%%%$##$#$%%#$%%$##$#$%#$#$%%$##$%#$#$#$%#$$##$%#$%#$#$#$$##$#$#$%#$%#$$#%%#$%#$%#$$##$#$#$#$#$%#$$#%#$#$#$%%#$$##$#$#$#$#$%#$$##$#$#$%#$%#$$##$%#$%#$%#$$##$#$#$#$#$%#$$##$%#$#$%%#$$##$#$#$#$#$%#$$##$#$#$%#$%#$$#%#$%%#$%#$$##$#$#$#$#$%#$$##$#$#$%%%%$#%#$#$%#$%#$$#%#$#$%#$%#$$#%#$#$%#$%#$$
1
2
#lang taco-victory
##$%#$%#$#$#$$##$%#$%#$#$#$$##$%#$#$#$%#$$##$#$#$%#$%%$#%#$%#$#$%%$##$#$%%#$%%$##$#$%%#$%%$#%%%%#$%%$##$#$#$#$#$%#$$#%%%#$%%%$#%%%%#$%%$##$%#$#$%%%$##$#$%%#$%%$##$#$%#$#$%%$##$%#$#$#$%#$$##$%#$%#$#$#$$##$#$#$%#$%#$$#%%#$%#$%#$$##$#$#$#$#$%#$$#%#$#$#$%%#$$##$#$#$#$#$%#$$##$#$#$%#$%#$$##$%#$%#$%#$$##$#$#$#$#$%#$$##$%#$#$%%#$$##$#$#$#$#$%#$$##$#$#$%#$%#$$#%#$%%#$%#$$##$#$#$#$#$%#$$##$#$#$%%%%$#%#$#$%#$%#$$#%#$#$%#$%#$$#%#$#$%#$%#$$
copy to clipboard
taco-victory/main.rkt
#lang br/quicklang
(require brag/support "grammar.rkt")
(provide taco-program taco-leaf
         taco not-a-taco
         show
         #%module-begin)

(module+ reader
  (provide read-syntax))

(define (tokenize-1 ip)
  ;; return one token (not all tokens)
  ;; ···
  )

(define (taco-program . pieces)
  ;; ···
  )

(define (taco-leaf . pieces)
  ;; ···
  )

(define (taco)
  ;; ···
  )

(define (not-a-taco)
  ;; ···
  )

(define (show pt)
  (display (apply string pt)))

(define (read-syntax src ip)
  (define token-thunk (λ () (tokenize-1 ip)))
  (define parse-tree (parse src token-thunk))
  (strip-bindings
   (with-syntax ([PT parse-tree])
     #'(module winner taco-victory
         (show PT)))))
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#lang br/quicklang
(require brag/support "grammar.rkt")
(provide taco-program taco-leaf
         taco not-a-taco
         show
         #%module-begin)

(module+ reader
  (provide read-syntax))

(define (tokenize-1 ip)
  ;; return one token (not all tokens)
  ;; ···
  )

(define (taco-program . pieces)
  ;; ···
  )

(define (taco-leaf . pieces)
  ;; ···
  )

(define (taco)
  ;; ···
  )

(define (not-a-taco)
  ;; ···
  )

(define (show pt)
  (display (apply string pt)))

(define (read-syntax src ip)
  (define token-thunk (λ () (tokenize-1 ip)))
  (define parse-tree (parse src token-thunk))
  (strip-bindings
   (with-syntax ([PT parse-tree])
     #'(module winner taco-victory
         (show PT)))))
copy to clipboard
taco-victory/grammar.rkt
#lang brag
taco-program : ;; ···
taco-leaf : ;; ···
taco : ;; ···
not-a-taco : ;; ···
1
2
3
4
5
#lang brag
taco-program : ;; ···
taco-leaf : ;; ···
taco : ;; ···
not-a-taco : ;; ···
copy to clipboard
← prev next →