From 70167cdc3e538225e52761bd15917ec1ea91729b Mon Sep 17 00:00:00 2001 From: Andrew Schleifer Date: Tue, 15 Feb 2011 20:06:31 -0600 Subject: [PATCH] Add question-mark forms for predicate functions --- nu/nu.nu | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/nu/nu.nu b/nu/nu.nu index b5ae43f..f517760 100644 --- a/nu/nu.nu +++ b/nu/nu.nu @@ -34,13 +34,37 @@ (let ((r (NuMath random))) (* maximum (- (/ r maximum) ((/ r maximum) intValue)))))) +(global atom? + (do (x) + (x atom))) + (global char? (do (x) (eq (x class) ('a' class)))) -(global atom? - (do (x) - (x atom))) +(global eq? + (do (x y) + (eq x y))) + +(global ge? + (do (x y) + (ge x y))) + +(global gt? + (do (x y) + (gt x y))) + +(global le? + (do (x y) + (le x y))) + +(global lt? + (do (x y) + (lt x y))) + +(global ne? + (do (x y) + (ne x y))) (global number? (do (x)