Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

I thought I fixed MODF-EVAL, but I actually broke it much more. Rever…

…ted that

change.  What this means, however, is that you might get no meaningful error at
all if you try modf with something without a defined expansion.
  • Loading branch information...
commit 938a5b60b4794a53cef68984ab4fa2b20b9397cb 1 parent 19ff550
Zach Kost-Smith authored
Showing with 7 additions and 5 deletions.
  1. +4 −0 modf-test.lisp
  2. +3 −5 modf.lisp
4 modf-test.lisp
View
@@ -3,6 +3,9 @@
(in-root-suite)
+(deftest modf-eval-test ()
+ (is (equal '(1 t 3 4) (modf (second (modf-eval '(1 2 3 4))) t))) )
+
(defsuite* lisp-types)
(deftest test-lists ()
@@ -99,6 +102,7 @@
(is (eql -1 (test-struct2-c (modf (test-struct2-c s2) -1)))) ))
(deftest run-tests ()
+ (modf-eval-test)
(test-lists)
(test-arrays)
(test-structs)
8 modf.lisp
View
@@ -165,8 +165,8 @@ specialize on any of ARGS."
(defun container-arg-n (expr)
(cond ((eql (car expr) 'cl:apply)
- (1+ (gethash (cadadr expr) *modf-nth-arg* 'no-nth-arg)) )
- (t (gethash (car expr) *modf-nth-arg* 'no-nth-arg)) ))
+ (1+ (gethash (cadadr expr) *modf-nth-arg*)) )
+ (t (gethash (car expr) *modf-nth-arg*)) ))
(defun modf-fn-defined? (expr)
(cond ((eql (car expr) 'cl:apply)
@@ -194,9 +194,7 @@ specialize on any of ARGS."
;; <<>>=
(defun modf-expand (new-val expr form)
- (cond ((atom expr)
- new-val )
- ((eql (car expr) 'modf-eval)
+ (cond ((or (atom expr) (eql (car expr) 'modf-eval))
new-val )
;; First, try rewrite rules
((gethash (car expr) *modf-rewrites*)
Please sign in to comment.
Something went wrong with that request. Please try again.