~williewillus/r16

r16/trick.rkt -rw-r--r-- 566 bytes
d426a80dVincent Lee Expose replied-to message contents 7 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#lang racket/base

;; #lang r16/trick <trick>

(module reader racket
  (provide (rename-out [read-syntax-trick read-syntax]
                       [read-trick read]))
  (define (read-trick [in (current-input-port)])
    (syntax->datum (read-syntax-trick 'program in)))
  (define (read-syntax-trick src in)
    (define trick (read in))
    (define string-args (string-trim (port->string in)))
    #`(module trick-module '#%kernel
        (#%provide r16-main)
        (define-values (r16-main)
          (lambda ()
            (call-trick '#,trick #,string-args))))))