MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: [Q] How to get rid of {}




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




  • Prev by Date: Re: Beginner's clothoid
  • Next by Date: Formatting posts
  • Prev by thread: Re: Beginner's clothoid
  • Next by thread: Formatting posts