小编lee*_*ski的帖子

常见的Lisp类型综合指南

也许这个问题太笼统了,不过我会尝试:是否有关于通用Lisp类型的全面指南?

我对此主题感到困惑:

为什么在申报非原始类型make-array:element-type都提升到t?是否有可能对实际声明的类型进行编译时或运行时检查?

为什么CLOS插槽定义的类型不能用作约束,而允许将任何类型的值放入插槽?再次,检查如何?

函数类型声明与declare.. 相同,它们只是对编译器的优化提示吗?

另外,我可以使用自定义类型说明符,包括satisfies在前面提到的地方进行一些可靠的检查,还是只能将它们用于typepetc的显式检查?

如您所见,我的脑海有些混乱,因此,非常感谢任何简洁的指南(或一组指南)。

我在SBCL上工作,但也很高兴了解实现之间的差异。

types common-lisp clos slots

4
推荐指数
2
解决办法
813
查看次数

Properly load-file for interactive Common Lisp development

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 …

emacs common-lisp slime read-eval-print-loop

3
推荐指数
1
解决办法
87
查看次数

标签 统计

common-lisp ×2

clos ×1

emacs ×1

read-eval-print-loop ×1

slime ×1

slots ×1

types ×1