1
0
Fork 0
cl-sites/HyperSpec-7-0/HyperSpec/Body/03_dda.htm

39 lines
3.8 KiB
HTML
Raw Normal View History

2024-04-01 10:24:07 +02:00
<!-- Common Lisp HyperSpec (TM), version 7.0 generated by Kent M. Pitman on Mon, 11-Apr-2005 2:31am EDT -->
<HTML>
<HEAD>
<TITLE>CLHS: Section 3.4.4.1</TITLE>
<LINK HREF="../Data/clhs.css" REL="stylesheet" TYPE="text/css" />
<META HTTP-EQUIV="Author" CONTENT="Kent M. Pitman">
<META HTTP-EQUIV="Organization" CONTENT="LispWorks Ltd.">
<LINK REL=TOP HREF="../Front/index.htm">
<LINK REL=COPYRIGHT HREF="../Front/Help.htm#Legal">
<LINK REL=DISCLAIMER HREF="../Front/Help.htm#Disclaimer">
<LINK REL=PREV HREF="03_dd.htm">
<LINK REL=UP HREF="03_dd.htm">
<LINK REL=NEXT HREF="03_ddaa.htm">
</HEAD>
<BODY>
<H1><A REV=MADE HREF="http://www.lispworks.com/"><IMG WIDTH=80 HEIGHT=65 ALT="[LISPWORKS]" SRC="../Graphics/LWSmall.gif" ALIGN=Bottom></A><A REL=TOP HREF="../Front/index.htm"><IMG WIDTH=237 HEIGHT=65 ALT="[Common Lisp HyperSpec (TM)]" SRC="../Graphics/CLHS_Sm.gif" ALIGN=Bottom></A> <A REL=PREV HREF="03_dd.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="03_dd.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="03_ddaa.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>
3.4.4.1 Destructuring by Lambda Lists</H2> <P>
Anywhere in a <A REL=DEFINITION HREF="26_glo_m.htm#macro_lambda_list"><I>macro lambda list</I></A> where a parameter name can appear, and where <A REL=DEFINITION HREF="26_glo_o.htm#ordinary_lambda_list"><I>ordinary lambda list</I></A> syntax (as described in <A REL=CHILD HREF="03_da.htm">Section 3.4.1 (Ordinary Lambda Lists)</A>) does not otherwise allow a <A REL=DEFINITION HREF="26_glo_l.htm#list"><I>list</I></A>, a <A REL=DEFINITION HREF="26_glo_d.htm#destructuring_lambda_list"><I>destructuring lambda list</I></A> can appear in place of the parameter name. When this is done, then the argument that would match the parameter is treated as a (possibly dotted) <A REL=DEFINITION HREF="26_glo_l.htm#list"><I>list</I></A>, to be used as an argument list for satisfying the parameters in the embedded <A REL=DEFINITION HREF="26_glo_l.htm#lambda_list"><I>lambda list</I></A>. This is known as destructuring. <P>
Destructuring is the process of decomposing a compound <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>object</I></A> into its component parts, using an abbreviated, declarative syntax, rather than writing it out by hand using the primitive component-accessing functions. Each component part is bound to a variable. <P>
A destructuring operation requires an <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>object</I></A> to be decomposed, a pattern that specifies what components are to be extracted, and the names of the variables whose values are to be the components. <P>
<A REL=CHILD HREF="03_ddaa.htm"><H2>
3.4.4.1.1 Data-directed Destructuring by Lambda Lists</H2></A><P>
<A REL=CHILD HREF="03_ddab.htm"><H2>
3.4.4.1.2 Lambda-list-directed Destructuring by Lambda Lists</H2></A><P><P>
<HR>
<A REL=NAVIGATOR HREF="../Front/StartPts.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Starting Points]" SRC="../Graphics/StartPts.gif" ALIGN=Bottom></A><A REL=TOC HREF="../Front/Contents.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Contents]" SRC="../Graphics/Contents.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Master.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Index]" SRC="../Graphics/Index.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Symbol.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Symbols]" SRC="../Graphics/Symbols.gif" ALIGN=Bottom></A><A REL=GLOSSARY HREF="../Body/26_a.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Glossary]" SRC="../Graphics/Glossary.gif" ALIGN=Bottom></A><A HREF="../Front/X3J13Iss.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Issues]" SRC="../Graphics/Issues.gif" ALIGN=Bottom></A><BR>
<A REL=COPYRIGHT HREF="../Front/Help.htm#Legal"><I>Copyright 1996-2005, LispWorks Ltd. All rights reserved.</I></A><P>
</BODY>
</HTML>