12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- (module (arguile base ctrl))
- (use ((srfi srfi-1) #:select (append-map lset-difference))
- (arguile guile)
- (arguile base mac)
- (arguile base fn)
- (ice-9 control))
- (re-export abort (call/cc . c/cc) (call/ec . c/ec))
- (export-syntax do = aif it & $>)
- (mac do ((_ e1 ...) #'(begin e1 ...)))
- ;;; TODO: check if var is a free variable, and if so, define it
- (mac =
- ((_ var val) #'(set! var val))
- ((_ var val rest ...) #'(do (set! var val) (= rest ...))))
- (mac aif x
- ((_ test then else)
- (let-syn it (datum->syntax x 'it)
- #'(let it test (if it then else)))))
- (mac & ((_ e1 ...) #'(and e1 ...)))
- (defp c/prmt call-with-prompt)
- (defp c/vals call-with-values)
- (defp tag default-prompt-tag)
- (defp vals values)
- (defp =? _=)
- (defp 0? zero?)
- (defp 1? (n) (=? 1 n))
- (defp ~ not)
- (defp nil? null?)
- (defp flatn append-map)
- (defp &map and-map)
- (defp set\ lset-difference)
- (mac $>
- ((_ exp) #'(c/prmt (tag) (fn () exp) hdlr))
- ((_ exp hdlr) #'(c/prmt (tag) (fn () exp) hdlr))
- ((_ tag expr hdlr) #'(c/prmt (tag) (fn () exp) hdlr)))
- (def hdlr (cont f)
- ($> (tag) (f cont) hdlr))
|