【问题标题】:List of LOOP keywordsLOOP 关键字列表
【发布时间】:2019-02-13 15:35:03
【问题描述】:

是否有可以在 LOOP 宏中引入新子句的关键字列表? http://www.lispworks.com/documentation/lw51/CLHS/Body/m_loop.htm 提供了丰富的信息,但我仍然不清楚提供的语法中哪些单词是文字关键字而不是生产名称,以及是否有一些关键字只能出现在一个子句中,而不是引入一个新的子句.

【问题讨论】:

标签: loops common-lisp


【解决方案1】:

他们来了。这些可以引入一个子句:

名称条款

named

变量子句

initially finally for as with

主要条款

do collect collecting append
appending nconc nconcing into count
counting sum summing maximize return
maximizing minimize minimizing doing 
thereis always never if when
unless repeat while until

这些不引入从句

= and it else end from upfrom 
above below to upto downto downfrom 
in on then across being each the hash-key
hash-keys of using hash-value hash-values
symbol symbols present-symbol 
present-symbols external-symbol 
external-symbols fixnum float t nil of-type

但请注意,决定什么是关键字的是解析。例如在:

(loop for key in hash-values)

只有 forin 是关键字。

【讨论】:

    猜你喜欢
    • 2020-05-18
    • 2020-02-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-24
    相关资源
    最近更新 更多