add for macro library

This commit is contained in:
Yuichi Nishiwaki 2014-06-28 11:32:23 +09:00
parent e82a688a66
commit f37c88c174
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,2 @@
file(GLOB FOR_FILES ${PROJECT_SOURCE_DIR}/contrib/20.for/piclib/*.scm)
list(APPEND PICLIB_CONTRIB_LIBS ${FOR_FILES})

View File

@ -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))