Re: Special Input Characters' Reference Table
- To: mathgroup at smc.vnet.net
- Subject: [mg105523] Re: [mg105489] Special Input Characters' Reference Table
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Sun, 6 Dec 2009 01:32:29 -0500 (EST)
- Reply-to: hanlonr at cox.net
In the explanation for Slot you state: "{2^3} must be written as
(#[[1]]^#[[2]]) &[{2, 3}]" This can be written as
{#1^#2} &[2, 3]
{8}
However, what you wrote is
(#[[1]]^#[[2]]) &[{2, 3}]
8
Which would be done exactly as your first example
(#1^#2) &[2, 3]
8
Or using SlotSequence
Power[##] &[2, 3]
8
For // (Postfix) you might want to add a second example using a pure function such as
Pi // Round[#, .01] &
3.14
For ; its meaning is CompoundExpression. If you compound something with nothing (; is at end of statement) then the output is nothing (suppressed).
For >>> you misspelled PutAppend
"f @@ expr is equivalent to f[expr]" should read ""f @@ h[expr] is equivalent to f[expr]" For example,
Power @@ List[2, 3]
8
or
Power @@ {2, 3}
8
You could also include
<= LessEqual; less than or equal to
>= GreaterEqual; greater than or equal to
!= Unequal; not equal to
?? Information; get usage and attribute information
(? gets usage information only)
\ Escape in string (e.g., \n for linefeed, \t for tab, \" for quote, \\ for backslash)
http://reference.wolfram.com/mathematica/tutorial/Operators.html
http://reference.wolfram.com/mathematica/tutorial/KeyboardShortcutListing.html
Bob Hanlon
---- BenT <brtubb at pdmusic.org> wrote:
=============
I've found this table might useful for reference, so I've decided to
post it here. If there are any corrections, or omissions please let me
know.
! Not; Factorial
!! Get file
# Slot; (replacement value for Condition);
e.g. sqr[x_]:=x^2 is equal to (#^2)&
and thus 5^2 is equal to (#^2)&[5];
another example: 5^3 could be written as (#1^#2)&[5,3]
but note that {2^3} must be written as
(#[[1]]^#[[2]])&[{2,3}]
## SlotSequence
$ global variable prefix
& Function
&& And
% UseLastValue
%% use the next to last value
%n use the Output cell "n" result
() parenthesis for evaluation grouping
* Times; or string wildcard
*= auto multiply x by c; e.g. x*=c means x=x*c
+ Plus
++ Increment; PreIncrement;
e.g. ++v [v+1=v] or v++ [v=v+1]
+= AddTo; e.g. v+=d, equals, v=v+d
. Dot
.. Repeated[pattern]
, used to separate elements or parameters
- Substract
-- Decrement; PreDecrement;
e.g. --v [v-1=v] or v-- [v=v-1]
-= SubstractFrom; e.g. v-=d, equals, v=v-d
-> Rule
/ Divide
/= DivideBy; auto divide x by c; e.g. x/=c means x=x/c
/. ReplaceAll
// postfix notation; e.g. N[Pi] = Pi//N;
ApplyHead to previous expression
//. ReplaceRepeated
/; Condition
/: ...= TagSet
/: ...:= TagSetdelayed
/@ Map
: Default, Optional, or Pattern
:: range function for Part, e.g. [[2::4]]
:= SetDelayed [for user functions]
:> RuleDelayed
; suppresses Output of expression to display
< Less
<< Get
<> StringJoin
=!= UnSameQ
= Set
== Equal
=. Unset
=== SameQ
> Greater
>> Put
>>> PuAppend
? Information; PatternTest (e.g. with MatchQ)
@ Prefix; f@expr = f[expr]
@@ Apply f to and replace the head of an expr;
e.g. f@@expr is equivalent to f[expr]
@@@ Apply to level 1 only;
e.g. f@@@expr = Apply[f,expr,{1}]
[] brackets for Function delimiters
[[i]] used with Part, e.g. Part[f,i]
^ Power
^:= UpSetDelayed
^= UpSet
^^ BaseForm
_ Blank (for general pattern matching)
__ DoubleBlank (for pattern matching of one or more)
___ TripleBlank (for pattern matching, of zero or more)
` NumberMarks or precision
{} list braces
~ Infix[f {Subscript[e, 1],Subscript[e, 2],...}]
~~ StringExpression
| Alternative (used with patterns)
|| Or
--- Benjamin Tubb