如何通过CLISP中的变量为propertyList命名?

时间:2018-03-26 15:38:26

标签: common-lisp clisp

让我的代码成为:

(defun ct (x) 
                (setq x '(  (man noun singular)
                    (woman noun singular)
                    (likes verb singular)
                    (a article)
                    (man verbIplural)
                )
    )
)

如果我称之为(ct '(myplist)) 它怎么能解决这个问题?

1 个答案:

答案 0 :(得分:0)

CL-USER 20 > (defun ct (symbol) 
               (set symbol '((man noun singular)
                             (woman noun singular)
                             (likes verb singular)
                             (a article)
                             (man verbIplural))))
CT

CL-USER 21 > (ct 'myplist)
((MAN NOUN SINGULAR) (WOMAN NOUN SINGULAR)
 (LIKES VERB SINGULAR) (A ARTICLE) (MAN VERBIPLURAL))

CL-USER 22 > myplist
((MAN NOUN SINGULAR) (WOMAN NOUN SINGULAR)
 (LIKES VERB SINGULAR) (A ARTICLE) (MAN VERBIPLURAL))

在Lisp中,该列表实际上不是属性列表,而是关联列表