MathGroup Archive 2007

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

Search the Archive

Re: Slots & Ampersands


Mr Ajit Sen wrote:
>   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

Only # or ## can be drooped (constant functions that do not depend on 
the values of some parameters).
The symbol & marks the end of the definition of the pure function.

> 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?

No need: this is a constant function that always returns red.

>   Question 2
> 
>   Are there other similar constructs in Mathematica? [No # ]

Yes.

The thread called "& without #" is worth reading. See
http://forums.wolfram.com/mathgroup/archive/2007/Jan/msg00605.html

Regards,
Jean-Marc


  • Prev by Date: Re: Integrate
  • Next by Date: Re: About TableForm
  • Previous by thread: Re: Slots & Ampersands
  • Next by thread: Re: Slots & Ampersands