《通链参考手册》


Macro DESTRUCTURING-BIND

●语法设定:

destructuring-bind lambda-list expression declaration* form*

=> result*

●参数和值:

lambda-list---a destructuring lambda list.

expression---a form.

declaration---a declare expression; not evaluated.

forms---an implicit progn.

results---the values returned by the forms.

●详情:

destructuring-bind binds the variables specified in lambda-list to the corresponding values in the tree structure resulting from the evaluation of expression; then destructuring-bind evaluates forms.

The lambda-list supports destructuring as described in Section 3.4.5 (Destructuring Lambda Lists).

●例子:

 (defun iota (n) (loop for i from 1 to n collect i))       ;helper
 (destructuring-bind ((a &optional (b 'bee)) one two three)
     `((alpha) ,@(iota 3))
   (list a b three two one)) =>  (ALPHA BEE 3 2 1)

●受制于: 无。

●例外情况:

If the result of evaluating the expression does not match the destructuring pattern, an error of type error should be signaled.

●更多信息:

macrolet, defmacro

●说明: 无。


X3J13设计清单非标准部分,可查下面章节:


◇首页 § ◎章节目录 § □内容索引 § ○符号索引 § △术语表 § ※设计草案