RE: [Q] How to get rid of {}
- To: mathgroup@smc.vnet.net
- Subject: [mg10738] RE: [mg10685] [Q] How to get rid of {}
- From: Ersek_Ted%PAX1A@mr.nawcad.navy.mil
- Date: Mon, 2 Feb 1998 00:44:32 -0500
Alessandro Rossi wrote:
----------
|I'm just curious to ask if is it possible to get rid of the {} symbols
|in a plain list of this kind {a1, a2, a3, ..., an} when you want to
use |the ordered sequence of a1, a2, a3, ..., an as arguments for a
|function.
|
|e.g.
|If I have the following list:
|list={True, False, True}
|
|how can I computethe And Function of the three arguments of list: |
Do the following:
In[1]:=
lst={True, False, True};
And@@lst
Out[1]=
False
You can also do this with other function "foo".
In[2]:=
foo@@lst
Out[2]=
foo[True,False,True]
In both of the above "@@" is shorthand for Apply. The FullForm is;
In[3]:=
Apply[foo,lst]
Out[3]=
foo[True,False,True]
Ted Ersek