|
From: Stas B. <sta...@gm...> - 2018-04-07 00:26:17
|
Macros do not work at read time. And sb-mop has no such symbol, so your
code can't work no matter what you lock or unlock.
Might I suggest some portable code instead:
(defmethod method-name ((thing standard-method))
(let ((gf (c2mop:method-generic-function thing)))
(when gf
(c2mop:generic-function-name gf))))
On Sat, Apr 7, 2018 at 2:58 AM Greg Bennett <gwb...@se...> wrote:
> From Greg Bennett, Using sbcl-1.4.0 under Linux Mint 64-bit.
>
> While porting some code, I need to compile a method on method-name.
> I have wrapped this in sb-ext:with-unlocked-packages :
>
> (sb-ext:with-unlocked-packages (:sb-mop)
> (defmethod method-name ((thing sb-mop::standard-method))
> (let ((gf (slot-value thing 'generic-function))
> )
> (when gf
> (slot-value gf 'sb-mop::name))
> )
> ))
>
> but still receive:
> ; caught ERROR:
> ; READ error during COMPILE-FILE:
> ;
> ; Lock on package SB-MOP violated when interning NAME while in package
> ; QUAIL-KERNEL.
> ; See also:
> ; The SBCL Manual, Node "Package Locks"
>
> so clearly I do not understand how this macro works. Indeed, perhaps I
> should do this
> differently.
>
> Thanks for advice and assistance.
> Cheers /GB
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Sbcl-devel mailing list
> Sbc...@li...
> https://lists.sourceforge.net/lists/listinfo/sbcl-devel
>
|