MathGroup Archive 2007

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

Search the Archive

Re: Slots & Ampersands


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