MathGroup Archive 2006

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

Search the Archive

Re: Short, simple - Why doesn't it work as a function


On 11/28/06 at 6:04 AM, wookiz at hotmail.com (wooks) wrote:

>{#, a} & /@ {a, b, c}

>gives {{a, a}, {b, a}, {c, a}} which is what i want.

>why[x_List] := {#, a} & /@ x; why[{a, b, c}]

>gives.

>{{a, a}, {{b, a}, {{c, a}, {}}}}

>not what I want.

That isn't what I get in a fresh session, i.e.

In[1]:=
why[x_]:={#,a}&/@x

In[2]:=
why[{a,b,c}]

Out[2]=
{{a, a}, {b, a}, {c, a}}

In[3]:=
$Version

Out[3]=
5.2 for Mac OS X (June 20, 2005)

--
To reply via email subtract one hundred and four


  • Prev by Date: Re: Short, simple - Why doesn't it work as a function
  • Next by Date: Re: Re: Limit of Infinitely Nested Expression (4.0
  • Previous by thread: Re: Short, simple - Why doesn't it work as a function
  • Next by thread: Re: Short, simple - Why doesn't it work as a function