Skip to content

Instantly share code, notes, and snippets.

@zhouqiang-cl
Last active November 22, 2016 06:15
Show Gist options
  • Save zhouqiang-cl/b3545d2368fd4eec3da8ad142c204716 to your computer and use it in GitHub Desktop.
Save zhouqiang-cl/b3545d2368fd4eec3da8ad142c204716 to your computer and use it in GitHub Desktop.
common lisp的 "#"
语法
#+test expression
#-test expression
#'function
#.foo
参数和值
test --- 是一个feature expression
function --- 函数名
描述
#+ 提供一个实时条件测试, 如果 test 成功 ,那么这一段语句(#+test expression)表示由 expression 组成的对象。如果 test 失败,那么这被看成空行
#- 提供一个实时条件测试, 如果 test 失败 ,那么这一段语句(#+test expression)表示由 expression 组成的对象。如果 test 成功,那么这被看成空行
#' 对函数进行调用
#. 在读取文件的时候对 foo 进行求值, 而不是运行的时候求值. 个人感觉可以减少运行时求值的性能消耗
代码片段
* #+sbcl (list 1 2)
(1 2)
* (apply #'+ '(1 2))
3
feature 表示 common lisp 的属性(如系统环境和common lisp的实现)
feature expressions 有以下几个方式
feature
(not feature-conditional)
(and feature-conditional*)
(or feature-conditional*)
TODO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment