MathGroup Archive 2006

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg71788] Re: [mg71765] Short, simple - Why doesn't it work as a function
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Wed, 29 Nov 2006 02:56:30 -0500 (EST)
  • Reply-to: hanlonr at cox.net

Works fine here.

$Version

5.2 for Mac OS X (June 20, 2005)

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

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


Bob Hanlon

---- wooks <wookiz at hotmail.com> 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.
> 
> I've checked the FullForms and they are different - why??
> 


  • Prev by Date: Re: Short, simple - Why doesn't it work as a function
  • Next by Date: Re: Short, simple - Why doesn't it work as a function
  • 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