commit d21451cf6050951ba842c7a0b651b71d8ecfb851
parent 6ded35e1c952d65dedd4ce081ea51611c92258ad
Author: tomas <tomas@logand.com>
Date: Thu, 8 Oct 2009 00:18:59 +0200
pair and atom added
Diffstat:
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/java.wl b/java.wl
@@ -24,6 +24,8 @@
(de =T (X) (== T X))
(de nT (X) (not (== T X)))
+(de atom (X) (not (pair X)))
+
(de rest () (cdr *Args))
(de args () (bool (cdr *Args)))
diff --git a/wl.java b/wl.java
@@ -631,6 +631,10 @@ class wl implements Runnable {
L.cdr(Z);
return Z;
}});
+ fn("pair", new Fn() {public Any fn(Any E) {
+ Any X = eval(E.cdr().car());
+ return X.isCons() ? X : NIL;
+ }});
fn("jnew", new Fn() {public Any fn(Any E) { // jnew 'cls [arg ...]
Any I = E.cdr();