CLOS: How to make a slot have an enforced type of vector of symbols?

后端 未结 2 2031
轮回少年
轮回少年 2021-01-19 01:53

I\'m trying to create a class that can store a vector of symbols in a slot in SBCL. I cannot figure out how to set it up.

My best guess thus far has been

         


        
2条回答
  •  滥情空心
    2021-01-19 01:55

    I know I'm probably too late, but you should wrap around your classe declaration with a optimization for safety. For example:

    (locally (declare (optimize safety))
        (defclass test-class ()
          ((some-slot :type real :initarg :some-slot :accessor :test-some-slot))))
    

提交回复
热议问题