init commit

This commit is contained in:
2024-10-23 09:02:27 -05:00
commit 76b11b0cf5
5 changed files with 78 additions and 0 deletions

20
d-.scm Normal file
View 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))))