From ded31df310122b0252c69bff90b915c3e5b0ad20 Mon Sep 17 00:00:00 2001 From: Masaya Tojo Date: Sun, 16 Jun 2024 13:06:25 +0900 Subject: Use `receive` syntax in `do` syntax --- algebraic-structures.monad.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/algebraic-structures.monad.scm b/algebraic-structures.monad.scm index dd9b850..8e906e3 100644 --- a/algebraic-structures.monad.scm +++ b/algebraic-structures.monad.scm @@ -4,6 +4,7 @@ (apply scheme:apply) (map scheme:map) (do scheme:do)) + (chicken base) M) (import-for-syntax matchable (chicken syntax) @@ -31,8 +32,8 @@ (every symbol? var) (symbol? let-stx) (compare let-stx (inject 'let-values)) (symbol? =-stx) (compare =-stx (inject '=))) - `(call-with-values (lambda () ,expr) - (lambda ,var ,acc))) + `(receive ,var ,expr + ,acc)) (else `(>>= ,binding (lambda (_) ,acc))))] [expr -- cgit v1.2.3