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

MathGroup Archive 2007

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

Search the Archive

Re: Slots & Ampersands

  • To: mathgroup at smc.vnet.net
  • Subject: [mg74388] Re: Slots & Ampersands
  • From: Peter Pein <petsie at dordos.net>
  • Date: Mon, 19 Mar 2007 22:03:02 -0500 (EST)
  • References: <etlq8s$rab$1@smc.vnet.net>

Mr Ajit Sen schrieb:
>   Dear MathGroup,
> 
>  I've always regarded the Slot and Ampersand as being
>  inseparable in Mathematica (the Laurel & Hardy of 
>  Mathematica?), and was surprised to find one of them absent
> in
> 
>    Plot[Sin[x], {x, 0, 2Pi}, ColorOutput -> 
>       (RGBColor[1, 0, 0]&)]
> 
>  [Help Browser under ColorOutput::colpc ,Examples]
> 
>   Question 1
> 
>   Where is Laurel gone? Is he inside ColorOutput or
>   RGBColor?
> 
>   Question 2
> 
>   Are there other similar constructs in Mathematica? [No # ]
> 
>   Thanks for your help.
> 
>   Ajit Sen.
> 

Hello,

there is no need for a '#' in a constant-valued function:

In[1]:= f = myConstantFunctionValue & ;

In[2]:= f[foo]
Out[2]= myConstantFunctionValue
In[3]:= f'[bar]
Out[3]= 0

(Hardy is quite boring without Laurel, isn't he?)

Peter


  • Prev by Date: RE: About TableForm
  • Next by Date: Re: Slots & Ampersands
  • Previous by thread: Re: simple sequence problem
  • Next by thread: Re: Slots & Ampersands