diff --git a/module/mes/scm.mes b/module/mes/scm.mes index 9beac54b..9bd53581 100644 --- a/module/mes/scm.mes +++ b/module/mes/scm.mes @@ -351,3 +351,7 @@ (define (negate proc) (lambda args (not (apply proc args)))) + +(define (const . rest) + (lambda (. _) + (car rest))) diff --git a/tests/scm.test b/tests/scm.test index 7254d184..98055a9f 100755 --- a/tests/scm.test +++ b/tests/scm.test @@ -159,4 +159,7 @@ exit $? (pass-if-equal "octal" 65 #o101) (pass-if-equal "hex" 257 #x101) +(pass-if-equal "negate" #t ((negate eq?) 0 1)) +(pass-if-equal "const" 42 ((const 42) 1 2 3 4)) + (result 'report)