Re: Slots & Ampersands
- To: mathgroup at smc.vnet.net
- Subject: [mg74407] Re: [mg74359] Slots & Ampersands
- From: Murray Eisenberg <murray at math.umass.edu>
- Date: Tue, 20 Mar 2007 05:50:27 -0500 (EST)
- Organization: Mathematics & Statistics, Univ. of Mass./Amherst
- References: <200703191053.FAA27902@smc.vnet.net>
- Reply-to: murray at math.umass.edu
"RGBColor[1, 0, 0]" designates a constant, not a function. By contrast,
"RGBColor[1, 0, 0]&" designates a function -- an abbreviation for
Function[x, RGBColor[1, 0, 0]]
or even just for
Function[RGBColor[1, 0, 0]].
This is the way to form an anonymous (i.e., no-name) constant function.
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
> 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.
>
>
>
>
>
> ___________________________________________________________
> To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com
>
--
Murray Eisenberg murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305
- References:
- Slots & Ampersands
- From: Mr Ajit Sen <senra99@yahoo.co.uk>
- Slots & Ampersands