[Openmcl-devel] Today's WTF moment

Ron Garret ron at flownet.com
Sun Apr 10 12:48:29 PDT 2016


? (funcall (lambda () (%int-to-ptr -1)))
#<A Foreign Pointer #xFFFFFFFFFFFFFFFF>

? (let ((x -1)) (%int-to-ptr x))
#<A Foreign Pointer #xFFFFFFFFFFFFFFFF>

But...

? (%int-to-ptr -1)
> Error: The value -1 is not of the expected type (UNSIGNED-BYTE 64).

? (loop for x in '(-1) collect (%int-to-ptr x))
> Error: The value -1 is not of the expected type (UNSIGNED-BYTE 64).

? (loop for x in '(-1) collect (let ((y x)) (%int-to-ptr y)))
> Error: The value -1 is not of the expected type (UNSIGNED-BYTE 64).

? (loop for x in '(-1) collect (funcall (lambda () (%int-to-ptr x))))
> Error: The value -1 is not of the expected type (UNSIGNED-BYTE 64).

? (defun foo (x) (%int-to-ptr x))
FOO
? (foo -1)
> Error: The value -1 is not of the expected type (UNSIGNED-BYTE 64).




More information about the Openmcl-devel mailing list