Created
December 14, 2016 07:27
-
-
Save zhouqiang-cl/35038be5463d90b64e96770efbe958e1 to your computer and use it in GitHub Desktop.
common lisp 的函数 CLASS-OF
This file contains hidden or 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
语法 | |
class-of object => class | |
参数和值 | |
object --- 一个 object | |
class --- 一个 class object | |
描述 | |
返回 object 的类, 其中object 是这个类的直接实例 | |
代码 | |
* (class-of 'fre) | |
#<BUILT-IN-CLASS SYMBOL> | |
* (class-of 2/3) | |
#<BUILT-IN-CLASS RATIO> | |
* (defclass book () ()) | |
#<STANDARD-CLASS BOOK> | |
* (class-of (make-instance 'book)) | |
#<STANDARD-CLASS BOOK> | |
* (defclass novel (book) ()) | |
#<STANDARD-CLASS NOVEL> | |
* (class-of (make-instance 'novel)) | |
#<STANDARD-CLASS NOVEL> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment