Skip to content

Instantly share code, notes, and snippets.

@zhouqiang-cl
Created December 21, 2016 08:44
Show Gist options
  • Save zhouqiang-cl/df605e75a37851f8a60d6a08209131b7 to your computer and use it in GitHub Desktop.
Save zhouqiang-cl/df605e75a37851f8a60d6a08209131b7 to your computer and use it in GitHub Desktop.
common lisp 的函数 COERCE
语法
coerce object result-type => result
参数和值
object --- 一个 object
result-type --- 一个类型指示符
result --- 一个 object, result-type 类型
描述
强制将 object 转换成 result-type 类型
代码
* (coerce '(a b c) 'vector)
#(A B C)
* (coerce 'a 'character)
#\A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment