-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.rkt
31 lines (24 loc) · 911 Bytes
/
main.rkt
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
#lang racket/base
(provide (all-from-out "racket.rkt"))
(require "racket.rkt")
(module reader racket/base ;; TODO: refactor it with syntax/module-reader
(require racket/list)
(provide (rename-out [ming-read read]
[ming-read-syntax read-syntax]))
(define (ming-read in)
(syntax->datum
(ming-read-syntax #f in)))
(define (ming-read-syntax src in)
(define module-name (string->symbol (path->string (path-replace-extension (last (explode-path "/home/yanying/tmp.rkt")) ""))))
(define module-codes (let loop ([lst (read in)]
[result '()])
(if (eof-object? lst)
result
(loop (read in)
(append result (list lst))))))
#`(module #,module-name racket
(require ming/core ming/racket)
#,@module-codes
)
)
)