Bad slot inheritance in ECL

Daniel Kochmański daniel at turtleware.eu
Tue Dec 27 08:17:03 UTC 2016


(slot-value (make-instance 'foo-op) 'gather-type) ;-> :object

Works OK for me. I think that the problem is somewhere with your
make-operation and gather-type functions indirection magic (I'm not
saying its not triggered by some bug in ECL, but it's doesn't look like
a problem with allocation).

Faré writes:

> I'm facing an "interesting" bug in ECL: in my branch of cffi at
> https://github.com/fare/cffi
> I try to define a static-image-op that has gather-operation
> 'compile-op and gather-type :object because I want to force all
> objects to be linked, and using the same 'lib-op and :static-library
> as image-op cause objects unreferenced by ECL to be dropped. However,
> though I override these slots in my defclass, they don't seem
> effective.
>
> (require "asdf")
> (asdf:load-system :cffi-toolchain)
>
> (in-package :cffi-toolchain)
> (uiop-debug)
>
> (defclass foo-op (image-op)
>   ((gather-type :initform :object :allocation :class)))
>
> (defun g (o) (asdf/bundle::gather-type (make-operation o)))
>
> (DBG :foo
>      (g 'image-op) ;==> :static-library, as expected
>      (g 'static-image-op) ;==> :static-library, but expected :object
>      (g 'static-program-op) ;==> :static-library, but expected :object
>      (g 'foo-op)) ;==> :static-library, but expected :object
>
> I tried to extract a smaller test case by recreating in a file the
> hierarchy of static-image-op, keeping only the definitions and
> overrides for slot gather-type, but then it worked. Maybe the
> combination of eval-when's and/or the compilation and loading play a
> role in making the bug happen.
>
> —♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org
> The only way for a reporter to look at a politician is down.
>                — H.L. Mencken


-- 
Daniel Kochmański ;; aka jackdaniel | Przemyśl, Poland
TurtleWare - Daniel Kochmański      | www.turtleware.eu

"Be the change that you wish to see in the world." - Mahatma Gandhi



More information about the ecl-devel mailing list