Fix https://github.com/Clozure/ccl/issues/350 : set lfun-bits inside set-funcallable-instance-function#369
Fix https://github.com/Clozure/ccl/issues/350 : set lfun-bits inside set-funcallable-instance-function#369digikar99 wants to merge 1 commit intoClozure:masterfrom
Conversation
|
What is the root cause of the error? Why does this particular case of bit-setting fix it? |
|
The most I have been able to figure out so far is that the warning comes from However, specialization-store does not still work well with this: (in-package :specialization-store)
(defstore foo (x))
(defspecialization foo (x) t
x)
(defun foo-caller (x)
(foo x))Compiling the last form still yields: ; In FOO-CALLER: In the call to FOO with arguments (X),
; 1 argument was provided, but at most 0 are accepted
; by the current global definition of FOO |
|
Is the |
|
The
And the following works, but I'm not sure why it should work: (lfun-bits funcallable-instance
(logior (lfun-bits funcallable-instance)
(lfun-bits function)))Change in required arguments seems to change the last 10 bits - or, no...? Something elaborate: ;;; Ignoring the warnings; and using https://www.rapidtables.com/convert/number/decimal-to-binary.html with 2s complement
;;; Is there a CL tool for the same?
CCL> (lfun-bits (lambda (a)))
-528482048 ;=> 11100000100000000000000100000000
CCL> (lfun-bits (lambda (a b)))
-528481792 ;=> 11100000100000000000001000000000
CCL> (lfun-bits (lambda (a b c d)))
-528481280 ;=> 11100000100000000000010000000000
CCL> (lfun-bits (lambda (&key a)))
-528482302 ;=> 11100000100000000000000000000010
CCL> (lfun-bits (lambda (&key a b)))
-528482302 ;=> 11100000100000000000000000000010
CCL> (lfun-bits (lambda (&optional a)))
-528482300 ;=> 11100000100000000000000000000100
CCL> (lfun-bits (lambda (&optional a b)))
-528482296 ;=> 11100000100000000000000000001000
CCL> (lfun-bits (lambda (&optional a b c d)))
-528482288 ;=> 11100000100000000000000000010000
CCL> (lfun-bits (lambda (&rest a)))
-528449536 ;=> 11100000100000001000000000000000
CCL> (lfun-bits (lambda (a &rest a)))
-528449280 ;=> 11100000100000001000000100000000
CCL> (length "1000000100000000")
16
|
Yes, CL-USER> (format nil "~32,'0B" (mod -528482288 (ash 1 32)))
"11100000100000000000000000010000" |
Please review if the bits set in the commit are the relevant ones.