-
-
Save epanji/48507968d74a3355e59ef9c544fda93e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(in-package :cl-user) | |
(defstruct foo a) | |
(defun expected-type (fun) | |
(handler-case (funcall (typecase fun | |
(function fun) | |
(symbol (symbol-function fun)) | |
(t nil)) | |
nil) | |
(type-error (c) (type-error-expected-type c)))) | |
(format t "~&;; ~A ~A => Type: ~A~%" | |
(lisp-implementation-type) | |
(lisp-implementation-version) | |
(expected-type 'foo-a)) | |
;; Results came from C-u C-x C-e | |
;; (slime-eval-last-expression) | |
;; SBCL 2.0.7 => Type: FOO | |
;; ECL 20.4.24 => Type: FOO | |
;; Armed Bear Common Lisp 1.7.1 => Type: STRUCTURE-OBJECT | |
;; Question: | |
;; Is it a bug for ABCL or implementation-dependent for TYPE-ERROR-EXPECTED-TYPE? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment