add for macro library
This commit is contained in:
parent
e82a688a66
commit
f37c88c174
|
@ -0,0 +1,2 @@
|
|||
file(GLOB FOR_FILES ${PROJECT_SOURCE_DIR}/contrib/20.for/piclib/*.scm)
|
||||
list(APPEND PICLIB_CONTRIB_LIBS ${FOR_FILES})
|
|
@ -0,0 +1,18 @@
|
|||
(define-library (picrin control list)
|
||||
(import (scheme base)
|
||||
(picrin control)
|
||||
(scheme write))
|
||||
|
||||
(define-syntax for
|
||||
(syntax-rules ()
|
||||
((_ expr)
|
||||
(reset (lambda () expr)))))
|
||||
|
||||
(define (in m)
|
||||
(shift (lambda (k)
|
||||
(apply append (map k m)))))
|
||||
|
||||
(define (yield x)
|
||||
(list x))
|
||||
|
||||
(export for in yield))
|
Loading…
Reference in New Issue