elisp nil equality
authorBT Templeton <bpt@hcoop.net>
Sat, 30 Jul 2011 04:22:15 +0000 (00:22 -0400)
committerBT Templeton <bpt@hcoop.net>
Fri, 3 Feb 2012 23:53:49 +0000 (18:53 -0500)
* module/language/elisp/boot.el (eq, equal): Return `#t' if both
  arguments are nil.
  (eql): New function.

module/language/elisp/boot.el

index cd5ddfb..c429a91 100644 (file)
 
 ;;; Equality predicates
 
-(fset 'eq (@ (guile) eq?))
-(fset 'equal (@ (guile) equal?))
+(defun eq (obj1 obj2)
+  (if obj1
+      (funcall (@ (guile) eq?) obj1 obj2)
+    (null obj2)))
+
+(defun eql (obj1 obj2)
+  (if obj1
+      (funcall (@ (guile) eqv?) obj1 obj2)
+    (null obj2)))
+
+(defun equal (obj1 obj2)
+  (if obj1
+      (funcall (@ (guile) equal?) obj1 obj2)
+    (null obj2)))
 
 ;;; Symbols