File r37/lisp/csl/html/r37_0053.html artifact c68a733814 part of check-in b7c3de82ef



<A NAME=LIST>

<TITLE>LIST</TITLE></A>
<b><a href=r37_idx.html>INDEX</a></b><p><p>



<B>LIST</B> _ _ _  _ _ _  _ _ _  _ _ _ <B>operator</B><P>
<P>
 
 <P>
<P>
The <em>list</em> operator constructs a list from its arguments. 
 <P> <H3> 
syntax: </H3>
<P>
<P>
<em>list</em>(&lt;item&gt; {,&lt;item&gt;}*) or 
 <em>list</em>() to construct an empty list. 
<P>
<P>
<P>
&lt;item&gt; can be any REDUCE scalar expression, including another list. 
Left and right curly brackets can also be used instead of the operator 
<em>list</em> to construct a list. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<P><PRE><TT>
liss := list(c,b,c,{xx,yy},3x**2+7x+3,df(sin(2*x),x));
	 


                            2
  LISS := {C,B,C,{XX,YY},3*X  + 7*X + 3,2*COS(2*X)} 


length liss; 

  6 


liss := {c,b,c,{xx,yy},3x**2+7x+3,df(sin(2*x),x)};
	 


                            2
  LISS := {C,B,C,{XX,YY},3*X  + 7*X + 3,2*COS(2*X)} 


emptylis := list(); 

  EMPTYLIS := {} 


a . emptylis; 

  {A}

</TT></PRE><P>Lists are ordered, hierarchical structures. The elements stay wher
e you 
put them, and only change position in the list if you specifically change 
them. Lists can have nested sublists to any (reasonable) level. The 

<A HREF=r37_0169.html>part</A> operator can be used to access elements anywhere 
within a list 
hierarchy. The 
<A HREF=r37_0157.html>length</A> operator counts the 
number of top-level elements 
of its list argument; elements that are themselves lists still only 
count as one element. 
<P>
<P>
<P>


REDUCE Historical
REDUCE Sourceforge Project | Historical SVN Repository | GitHub Mirror | SourceHut Mirror | NotABug Mirror | Chisel Mirror | Chisel RSS ]