(while
(not
(setq h
(cdr
(assoc
(getint "\nPlease enter the numeric number: ")
'((1 . 250)(2 . 550)(3 . -370)(4 . -740))
)
)
)
)
(print "Requires an integer between 1 and 4.")
) 评估一下需要cond来测试的几个条件,把出现频率高的写在前面,频率低的写在后面,这样可以节省运行时间 你说的葵花宝典在哪里? ketxu 发表于 2019-9-30 19:03
You can use list in this case :
Are you foreigner? 写不完的日记 发表于 2019-10-6 09:22
Are you foreigner?
牛逼!我还以为我喜欢去看国外的论坛,还是有外国人看我们论坛! 写不完的日记 发表于 2019-10-6 09:22
Are you foreigner?
Yeah, i am Vietnamese. Sorry for my bad language :( (VL-FILENAME-DIRECTORY (cond((FINDFILE "TT.vlx"))("")))
也可以这样用,防止FINDFILE返回NIL导致代码出错,可以COND返回""空字符。这样就不会出错 ketxu 发表于 2019-10-8 15:32
Yeah, i am Vietnamese. Sorry for my bad language
lisp is beyond boundries ! Welcome to the forum! 谢谢分享,支持
页:
1
[2]