Thank you for your comment

Beau­tiful Racket / appendix

  1. cd path/to/source
    mkdir dsl
    cd dsl
    raco pkg install
    1
    2
    3
    4
    > cd path/to/source
    > mkdir dsl
    > cd dsl
    > raco pkg install
    
    copy to clipboard
  2. cd path/to/source
    raco pkg new dsl
    cd dsl
    raco pkg install
    1
    2
    3
    4
    > cd path/to/source
    > raco pkg new dsl
    > cd dsl
    > raco pkg install
    
    copy to clipboard
dsl/main.rkt
#lang br
(module reader br
  (require module/that/provides/parse
           module/that/provides/tokenize)
  (provide read-syntax)
  (define (read-syntax name port)
    (define the-parse-tree (parse (tokenize port)))
    (strip-bindings
     #`(module dsl-mod-name dsl/expander
         #,the-parse-tree))))
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#lang br
(module reader br
  (require module/that/provides/parse
           module/that/provides/tokenize)
  (provide read-syntax)
  (define (read-syntax name port)
    (define the-parse-tree (parse (tokenize port)))
    (strip-bindings
     #`(module dsl-mod-name dsl/expander
         #,the-parse-tree))))
copy to clipboard
← prev next →