Re: Re: joining lists.
- To: mathgroup at smc.vnet.net
- Subject: [mg23838] Re: [mg23788] Re: joining lists.
- From: Andrzej Kozlowski <andrzej at tuins.ac.jp>
- Date: Mon, 12 Jun 2000 01:17:31 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
on 00.6.10 3:59 PM, Otto Linsuain at linsuain+ at andrew.cmu.edu wrote: > > Thanks to all that replied. Yes, I was definitely missing the obvious > solution: > > {#1,#2} & [list1,list2] produces {list1,list2} without the unnecessary > Join[{list1},{list2}]. > > I was glad to learn that {##} & can do the same with more than two > lists. Otto. > Since I was responsible for that latter answer I guess I should now point out the obvious: f[##] & is exactly the same as f, except that it will always evaluate its arguments first. So if a function has a HoldAll, HoldFirst or HoldRest attribute there will be a difference. Thus Plot[Table[x^i, {i, 1, 2}], {x, -1, 1}] will produce and error message while Plot[##] &[Table[x^i, {i, 1, 2}], {x, -1, 1}] will work (you can of course use Evaluate inside Plot instead). However, this has no relevance at all in the case of List. Andrzej -- Andrzej Kozlowski Toyama International University JAPAN http://platon.c.u-tokyo.ac.jp/andrzej/ http://sigma.tuins.ac.jp/