init commit
This commit is contained in:
20
d-.scm
Normal file
20
d-.scm
Normal file
@@ -0,0 +1,20 @@
|
||||
(define-module (d-)
|
||||
#:export
|
||||
(~>
|
||||
~>>
|
||||
partial))
|
||||
|
||||
(define-syntax ~>
|
||||
(syntax-rules ()
|
||||
[(_ v) v]
|
||||
[(_ v (fn args ...) more ...) (~> (fn v args ...) more ...)]
|
||||
[(_ v fn more ...) (~> (fn v) more ...)]))
|
||||
|
||||
(define-syntax ~>>
|
||||
(syntax-rules ()
|
||||
[(_ v) v]
|
||||
[(_ v (fn args ...) more ...) (~> (fn args ... v) more ...)]
|
||||
[(_ v fn more ...) (~> (fn v) more ...)]))
|
||||
|
||||
(define (partial fn . args)
|
||||
(lambda x (apply fn (append args x))))
|
||||
Reference in New Issue
Block a user