import (picrin readline) only when exists
This commit is contained in:
parent
ac15ac6e2d
commit
96a90810af
|
@ -3,8 +3,23 @@
|
||||||
(scheme read)
|
(scheme read)
|
||||||
(scheme write)
|
(scheme write)
|
||||||
(scheme eval)
|
(scheme eval)
|
||||||
(picrin readline)
|
(picrin macro)
|
||||||
|
(picrin library))
|
||||||
|
|
||||||
|
(define-syntax define-readline
|
||||||
|
(er-macro-transformer
|
||||||
|
(lambda (form rename compare)
|
||||||
|
(if (member '(picrin readline) (libraries))
|
||||||
|
`(import (picrin readline)
|
||||||
(picrin readline history))
|
(picrin readline history))
|
||||||
|
`(begin
|
||||||
|
(define (readline str)
|
||||||
|
(display str)
|
||||||
|
(read-line))
|
||||||
|
(define (add-history str)
|
||||||
|
#f))))))
|
||||||
|
|
||||||
|
(define-readline)
|
||||||
|
|
||||||
(define (repl)
|
(define (repl)
|
||||||
(let ((line (readline "> ")))
|
(let ((line (readline "> ")))
|
||||||
|
|
Loading…
Reference in New Issue