From d5ec78a3169a284a337a95fbe60f22aedfd98e4e Mon Sep 17 00:00:00 2001 From: Masaya Tojo Date: Sun, 9 Jun 2024 16:10:53 +0900 Subject: Confirm `var` is a symbol --- algebraic-structs.monad.make.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'algebraic-structs.monad.make.scm') diff --git a/algebraic-structs.monad.make.scm b/algebraic-structs.monad.make.scm index e7c8774..70ead19 100644 --- a/algebraic-structs.monad.make.scm +++ b/algebraic-structs.monad.make.scm @@ -14,11 +14,14 @@ (foldr (lambda (binding acc) (match binding [(var stx expr) - (if (and (symbol? stx) (compare stx '<-)) + (if (and (symbol? var) + (symbol? stx) + (compare stx '<-)) `(>>= ,expr (lambda (,var) ,acc)) `(>>= ,binding (lambda (_) ,acc)))] [(let-stx var =-stx expr) - (cond ((and (symbol? let-stx) (compare let-stx (inject 'let)) + (cond ((and (symbol? var) + (symbol? let-stx) (compare let-stx (inject 'let)) (symbol? =-stx) (compare =-stx (inject '=))) `((lambda (,var) ,acc) ,expr)) (else -- cgit v1.2.3