[Ecls-list] symbol-macro usage

Alexander Gavrilov angavrilov at gmail.com
Sun Feb 14 11:38:49 UTC 2010


> ...after reading these mails it seems like the redefinition is the
> least offensive solution, so i've pushed the changes in hu.dwim.common
> and hu.dwim.def implementing that.
> 
> Alexander, please check it on ECL and report back if it breaks by any chance...

The DWIM libraries seem to load OK, but I had to add the
following fixes to ECL:


--- a/src/cmp/cmpmain.lsp
+++ b/src/cmp/cmpmain.lsp
@@ -703,7 +703,7 @@ compiled successfully, returns the pathname of the compiled file"
               (setf warning-p t))
              ((typep i '(or compiler-error warning))
               (setf warning-p t failure-p t)))
-     finally (return (values (and (not failure-p) main-value) warning-p failure-p))))
+     finally (return (values (and #+nil (not failure-p) main-value) warning-p failure-p))))

 #-dlopen
 (defun compile (name &optional (def nil supplied-p))

Rationale: CLOS does not specify that the first value should be set 
           to NIL if failure-p is true, only if the compilation
           actually failed. In this case there were only some
           (warn...)s that remind about unimplemented code.

> The primary value returned by compile-file, output-truename, is the truename of the
> output file, or nil if the file could not be created. 


--- a/src/h/object.h
+++ b/src/h/object.h
@@ -747,6 +747,10 @@ enum ecl_ffi_tag {
        ECL_FFI_UNSIGNED_INT,
        ECL_FFI_LONG,
        ECL_FFI_UNSIGNED_LONG,
+#ifdef ecl_uint8_t
+        ECL_FFI_INT8_T,
+        ECL_FFI_UINT8_T,
+#endif
 #ifdef ecl_uint16_t
         ECL_FFI_INT16_T,
         ECL_FFI_UINT16_T,

Rationale: The enum contents must match the tables in ffi.d, or bad things happen.


--- a/src/clos/method.lsp                                                                   
+++ b/src/clos/method.lsp                                                                   
@@ -103,7 +103,7 @@
        (when in-closure-p
          (setf plist '(:needs-next-method-p FUNCTION))
          (setf real-body
-               `((let* ((.combined-method-args.
+               `((let* ((.closed-combined-method-args.
                          (locally (declare (special .combined-method-args.))
                            (if (listp .combined-method-args.)
                                .combined-method-args.
@@ -113,7 +113,7 @@
                             (unless .next-methods.
                               (error "No next method"))
                             (funcall (car .next-methods.)
-                                     (or args .combined-method-args.)
+                                     (or args .closed-combined-method-args.)
                                      (rest .next-methods.)))
                           (next-method-p ()
                             .next-methods.))

Rationale: Fix the call-next-method closure 
           (.combined-method-args. is now globally special)


--- a/src/clos/kernel.lsp                                                                   
+++ b/src/clos/kernel.lsp                                                                   
@@ -373,7 +373,7 @@                                                                         
          (loop for type in spec-how-list                                                   
                for name in (generic-function-lambda-list gf)                               
                for i from 0                                                                
-               when type collect (cons type (position name a-p-o))))                       
+               when type collect (cons type i)))                                           
     (let* ((g-f-l-l (generic-function-lambda-list gf)))                                    
       (when (consp g-f-l-l)                                                                
        (let ((required-arguments (rest (si::process-lambda-list g-f-l-l t))))              

Rationale: Fix the generic function method cache in presense of
           argument-precedence-order and (eql) methods.
           Try experimenting with the following definition:

(defgeneric zzz (a b c)
  (:argument-precedence-order b c a)
  (:method (a b c)
    (print (list a b c)))
  (:method ((a t) (b (eql 'foo)) c)
    (print "foo")))





More information about the ecl-devel mailing list