也许这个问题太笼统了,不过我会尝试:是否有关于通用Lisp类型的全面指南?
我对此主题感到困惑:
为什么在申报非原始类型make-array
的:element-type
都提升到t
?是否有可能对实际声明的类型进行编译时或运行时检查?
为什么CLOS插槽定义的类型不能用作约束,而允许将任何类型的值放入插槽?再次,检查如何?
函数类型声明与declare
.. 相同,它们只是对编译器的优化提示吗?
另外,我可以使用自定义类型说明符,包括satisfies
在前面提到的地方进行一些可靠的检查,还是只能将它们用于typep
etc的显式检查?
如您所见,我的脑海有些混乱,因此,非常感谢任何简洁的指南(或一组指南)。
我在SBCL上工作,但也很高兴了解实现之间的差异。
I would like to know, what is the common approach to common-lisp interactive development in emacs (i use sly, but i think the slime instructions should be the same)
say i have this file:
(eval-when (:compile-toplevel :load-toplevel :execute)
(ql:quickload :closer-mop))
(in-package :cl-user)
(defpackage :shapes
(:use :closer-common-lisp-user)
(:export #:rectangle))
(in-package :shapes)
(defclass rectangle ()
((height :initform 0.0 :initarg :height)
(width :initform 0.0 :initarg :width)))
Run Code Online (Sandbox Code Playgroud)
which is quite simple. Evaluating it experssion by expression seems to be ok, while loading the whole …