Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg71765] Short, simple - Why doesn't it work as a function
  • From: "wooks" <wookiz at hotmail.com>
  • Date: Tue, 28 Nov 2006 06:04:19 -0500 (EST)

{#, 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: using a different stylesheet
  • Next by Date: RE: using a different stylesheet
  • Previous by thread: Re: using a different stylesheet
  • Next by thread: Re: Short, simple - Why doesn't it work as a function