A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.lispworks.com/documentation/lw60/CLHS/Body/m_destru.htm below:

CLHS: Macro DESTRUCTURING-BIND

CLHS: Macro DESTRUCTURING-BIND Macro DESTRUCTURING-BIND

Syntax:

destructuring-bind lambda-list expression declaration* form*

=> result*

Arguments and Values:

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.

Description:

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).

Examples:

 (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)

Affected By: None.

Exceptional Situations:

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

See Also:

macrolet, defmacro

Notes: None.

The following X3J13 cleanup issues, not part of the specification, apply to this section:
Copyright 1996-2005, LispWorks Ltd. All rights reserved.

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4