[armedbear-cvs] r12114 - trunk/abcl/src/org/armedbear/lisp

Erik Huelsmann ehuelsmann at common-lisp.net
Sun Aug 23 19:08:07 UTC 2009


Author: ehuelsmann
Date: Sun Aug 23 15:08:04 2009
New Revision: 12114

Log:
Verify simple types (single symbol types) while
interpreting the THE special operator.

Note: This helps argument verification while
  interpreting structure slot accessors.


Modified:
   trunk/abcl/src/org/armedbear/lisp/SpecialOperators.java

Modified: trunk/abcl/src/org/armedbear/lisp/SpecialOperators.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/SpecialOperators.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/SpecialOperators.java	Sun Aug 23 15:08:04 2009
@@ -371,7 +371,15 @@
       {
         if (args.length() != 2)
           return error(new WrongNumberOfArgumentsException(this));
-        return eval(args.cadr(), env, LispThread.currentThread());
+        LispObject rv = eval(args.cadr(), env, LispThread.currentThread());
+
+        LispObject type = args.car();
+        if (type instanceof Symbol
+            || type instanceof BuiltInClass)
+            if (rv.typep(type) == NIL)
+                type_error(rv, type);
+
+        return rv;
       }
     };
 




More information about the armedbear-cvs mailing list