Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5379 > unrolled thread
| Started by | Richard Cohen <cohenrich@gmail.com> |
|---|---|
| First post | 2011-10-05 08:04 +0000 |
| Last post | 2011-10-06 08:36 +0000 |
| Articles | 5 — 5 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
can't find info about & /@ % Richard Cohen <cohenrich@gmail.com> - 2011-10-05 08:04 +0000
Re: can't find info about & /@ % "Kevin J. McCann" <Kevin.McCann@umbc.edu> - 2011-10-06 08:25 +0000
Re: can't find info about & /@ % A Retey <awnl@gmx-topmail.de> - 2011-10-06 08:29 +0000
Re: can't find info about & /@ % Simon <simonjtyler@gmail.com> - 2011-10-06 08:36 +0000
Re: can't find info about & /@ % "Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com> - 2011-10-06 08:36 +0000
| From | Richard Cohen <cohenrich@gmail.com> |
|---|---|
| Date | 2011-10-05 08:04 +0000 |
| Subject | can't find info about & /@ % |
| Message-ID | <j6h31i$6un$1@smc.vnet.net> |
First[Options[#, "ColorSpace"] & /@ %] could someone please explain the use of these & /@ % i've looked everywhere to no avail. rich
[toc] | [next] | [standalone]
| From | "Kevin J. McCann" <Kevin.McCann@umbc.edu> |
|---|---|
| Date | 2011-10-06 08:25 +0000 |
| Message-ID | <j6jol6$m6b$1@smc.vnet.net> |
| In reply to | #5379 |
# and & are parts of a Pure Function /@ is a shortcut for the Map function I suggest you use the Help to read about Pure Functions (It is a rather large and sometimes confusing topic for the beginner. Also very powerful.) And look up Map in the Help and check out the examples. This is probably less than you wanted, but your question is more than you probably realize. Kevin On 10/5/2011 4:04 AM, Richard Cohen wrote: > First[Options[#, "ColorSpace"]& /@ %] > could someone please explain the use of these& /@ % > i've looked everywhere to no avail. > rich >
[toc] | [prev] | [next] | [standalone]
| From | A Retey <awnl@gmx-topmail.de> |
|---|---|
| Date | 2011-10-06 08:29 +0000 |
| Message-ID | <j6jot2$ma5$1@smc.vnet.net> |
| In reply to | #5379 |
Am 05.10.2011 10:04, schrieb Richard Cohen: > First[Options[#, "ColorSpace"]& /@ %] > could someone please explain the use of these& /@ % > i've looked everywhere to no avail. My usual trick to find the meaning and documentation of all those shortcuts is to FullForm[Hold[]]: FullForm[Hold[First[Options[#, "ColorSpace"] & /@ %]]] In your case you want to look up Function, Map and Out. hth, albert
[toc] | [prev] | [next] | [standalone]
| From | Simon <simonjtyler@gmail.com> |
|---|---|
| Date | 2011-10-06 08:36 +0000 |
| Message-ID | <j6jp9n$md7$1@smc.vnet.net> |
| In reply to | #5379 |
All of these can be found in the Syntax guide page: http://reference.wolfram.com/mathematica/guide/Syntax.html But in particular, the & makes the preceding code, Options[#, "ColorSpace"]&, a pure fucntion: http://reference.wolfram.com/mathematica/ref/Function.html The /@ is short for Map (http://reference.wolfram.com/mathematica/ref/Map.html) and the % means the last output, and is short for Out[] (%n means Out[n]). So what you're doing is mapping the Options[#,"ColorSpace"]& function over the previous output, which hopefully is a list (or some container) of expressions that possess that option.
[toc] | [prev] | [next] | [standalone]
| From | "Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com> |
|---|---|
| Date | 2011-10-06 08:36 +0000 |
| Message-ID | <j6jpam$mdh$1@smc.vnet.net> |
| In reply to | #5379 |
Hi Richard, These are actually three operators: & (Function) is part of a pure function expression: e.g. #^2& is a function that squares it argument; # stands for the argument /@ is the infix form of the Map function, which can be used to map a function over a list of items % (Out) is the shorthand notation for the result returned in the most recent evaluation (presumably in this case the evaluation returned a list of items) How could you have found out this yourself? Well, - select the '&', press F1 (Help on Windows) and the second item is 'Function' - select /@, press F1 and the only result is 'Map' - select '%', press F1 and the second result is `Out` It's actually not that difficult. Cheers -- Sjoerd On Oct 5, 10:04 am, Richard Cohen <cohenr...@gmail.com> wrote: > First[Options[#, "ColorSpace"] & /@ %] > could someone please explain the use of these & /@ % > i've looked everywhere to no avail. > rich
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web