The "Unknown:"s below indicate that an entry is incomplete.
{ ... }(1) | block (grouping statements, especially when statements are not expressions) |
nothing needed | breaking lines (useful when end-of-line and/or indentation has a special meaning) |
/* ... */ | commenting (non nestable) |
// | commenting (until end of line) |
< > <= >= | comparison |
/** ... */(2) | documentation comment (non nestable) |
/// | documentation comment (until end of line) |
== != | equality / inequality (deep) |
System.GC.Collect() | force garbage collection |
( ... ) | grouping expressions |
(new System.Diagnostics.StackFrame(true)).GetFileLineNumber() (new System.Diagnostics.StackFrame(true)).GetFileName() | information about the current line and file |
case-sensitive | tokens (case-sensitivity (keywords, variable identifiers...)) |
[_a-zA-Z][_a-zA-Z0-9]* | tokens (variable identifier regexp) |
CamelCase or camelCase | tokens (what is the standard way for scrunching together multiple words) |
= | variable assignment or declaration (assignment) |
t v | variable assignment or declaration (declaration) |
f(a,b,...) | function call |
f() | function call (with no parameter) |
TryInvokeMember(3) | function called when a function is not defined (in dynamic languages) |
typ0 f(typ1 para1, typ2 para2, ...) { ... } | function definition |
void f(typ1 para1, typ2 para2, ...) { ... } | function definition (procedures) |
return(4) | function return value (breaks the control flow) |
continue / break | breaking control flow (continue / break) |
goto | breaking control flow (goto (unconditional jump)) |
return(4) | breaking control flow (returning a value) |
try a catch (exn) ... | exception (catching) |
finally | exception (cleanup: code executed before leaving) |
throw | exception (throwing) |
if (c) ... | if_then |
if (c) b1 else b2 | if_then_else |
c ? b1 : b2 | if_then_else |
do ... while (!c) | loop (do something until condition) |
for | loop (for "a la C" (while + initialisation)) |
for (int i = 10; i >= 1; i--) ... | loop (for each value in a numeric range, 1 decrement) |
for (int i = 1; i <= 10; i++) ... | loop (for each value in a numeric range, 1 increment (see also the entries about ranges)) |
for (int i = 1; i <= 10; i += 2) ... | loop (for each value in a numeric range, free increment) |
while (c) ... | loop (while condition do something) |
switch (val) { case v1: ...; break; case v2: case v3: ...; break; default: ...; break; }(5) | multiple selection (switch) |
; | sequence |
t v | annotation (or variable declaration) |
e as t | cast (downcast (need runtime checking)) |
(t) e | cast (upcast) |
using n = ... | declaration |
"readonly" fields(6) | mutability, constness (special cases) |
mutability is the default | mutability, constness (type of a mutable value) |
base | accessing parent method |
class | class declaration |
this | current instance |
typeof | get the type/class corresponding to an object/instance/value |
class child : parent | inheritance |
Dispose | manually call an object's destructor |
object.method(para) | method invocation |
object.property(7) | method invocation (with no parameter) |
object.method() | method invocation (with no parameter) |
o.Clone() | object cloning |
new class_name(...) | object creation |
is | testing class membership |
namespace p { ... } | declare |
using p | import (everything into current namespace) |
. | package scope |
s[n] | accessing n-th character |
(char) c | ascii to character |
'z' | character "z" |
(int) c | character to ascii |
char | character type name |
ToString | convert something to a string (see also string interpolation) |
Substring | extract a substring |
IndexOf | locate a substring |
LastIndexOf | locate a substring (starting at the end) |
@"..." | multi-line |
WriteLine | simple print (on any objects) |
WriteLine | simple print (printf-like) |
Format | sprintf-like |
+ | string concatenation |
== != | string equality & inequality |
Length | string size |
"\n" | strings (end-of-line (without writing the real CR or LF character)) |
"..." | strings (with no interpolation of variables) |
@"...""..." | strings (with no interpolation of variables) |
string | type name |
String | type name |
ToUpper / ToLower | upper / lower case character |
ToUpper / ToLower | uppercase / lowercase / capitalized string |
Unknown:
serialize (marshalling)
unserialize (un-marshalling)
false | false value |
! | logical not |
| / & | logical or / and (non short circuit (always evaluates both arguments)) |
|| / && | logical or / and (short circuit) |
true | true value |
bool | type name |
foreach (t v in l) ... | for each element do something |
String.Join(s, l) | join a list of strings in a string using a glue string |
new t[] { a, b, c } | list constructor |
length | list size |
a[i] | list/array indexing |
Reverse | reverse |
sort(8) | sort |
a[] | type name |
Unknown:
list concatenation
list flattening
adding an element at the beginning (list cons)
adding an element at index
adding an element at the end
first element
all but the first element
last element
get the first element and remove it
get the last element and remove it
is an element in the list
smallest / biggest element
iterate with index
remove duplicates
h[k] | dictionary (access: read/write) |
new t { {a, b}, {c, d} } | dictionary (constructor) |
Contains | dictionary (has the key ?) |
AllKeys | dictionary (list of keys) |
Remove | dictionary (remove by key) |
enum typ { n1; n2; ... }(9) | enumerated type declaration |
?? | optional value (null coalescing) |
null | optional value (null value) |
v | optional value (value) |
. | record (selector) |
& | reference (pointer) (creation) |
ref | reference (pointer) (creation) |
*(10) | reference (pointer) (dereference) |
Unknown:
record (type declaration)
union type declaration
dictionary (type name)
dictionary (merge)
range
+ / - / * / / | addition / subtraction / multiplication / division |
& / | / ^ | bitwise operators (and / or / xor) |
~ | bitwise operators (bitwise inversion) |
<< / >> | bitwise operators (left shift / right shift / unsigned right shift) |
Pow | exponentiation (power) |
Log10 | logarithm (base 10) |
Log | logarithm (base e) |
% | modulo (modulo of -3 / 2 is -1) |
- | negation |
1000.0, 1E3 | numbers syntax (floating point) |
0xf | numbers syntax (integers in base 2, octal and hexadecimal) |
1000 | numbers syntax (integers) |
mathematical | operator priorities and associativities (addition vs multiplication) |
Random ran = new Random(); ran.Next(...); | random (random number) |
Sqrt / Exp / Abs | square root / e-exponential / absolute value |
Sin / Cos / Tan | trigonometry (basic) |
Asin / Acos / Atan | trigonometry (inverse) |
/ Round / Floor / Ceiling | truncate / round / floor / ceil |
float, double | type name (floating point) |
short, int, long | type name (integers) |
Unknown:
random (seed the pseudo random generator)