seq | YAML |
a list | F#, OCaml, SML |
[a] | Haskell |
a[] | C# |
list | Maple, Python |
List | Io, Mathematica, Pliant |
Array or List | Perl6 |
ARRAY or LINKED_LIST | Eiffel |
Array or OrderedCollection | Smalltalk |
ARRAY | Perl |
array | PHP |
cell | Matlab |
vector | C++ |
Containers.Vectors.Vector or Ada.Containers.Doubly_Linked_Lists.List | Ada |
[]a | Go |
+ | E, Eiffel, merd, PHP, Pike, Python, Ruby, Vimscript |
, | Maple, Matlab, Perl, Smalltalk |
@ | F#, OCaml, SML |
~ | D |
& | Ada |
++ | Haskell |
||| | Icon |
array_merge | PHP |
merge | YCP |
concat | CoffeeScript, JavaScript, Tcl |
concatenate | Dylan |
nconc | Common Lisp, Emacs Lisp |
append | Beta, Common Lisp, Emacs Lisp, Go, Prolog, Rebol, Scheme |
Append | Oz |
appendSeq | Io |
arrayByAddingObjectsFromArray | Objective-C |
sentence | Logo |
Join | Mathematica |
one level depth
concat | F#, Haskell, Mercury, SML |
flatten | F#, Io, merd, OCaml, Prolog, YCP |
Flatten | Oz |
eval concat | Tcl |
ListTools[FlattenOnce] | Maple |
{*}$l | Tcl8.5 |
"$l" | FishShell |
recursive
flatten | Pike, Ruby |
ListTools[Flatten] | Maple |
Flatten | Mathematica |
[ a, b, c ](1) | CoffeeScript, E, Haskell, JavaScript, Maple, Matlab, merd, Perl, Perl6, PHP5, PostScript, Prolog, Python, Ruby, SML, Vimscript, YAML, YCP |
( a, b, c ) | Perl, Perl6 |
{ a, b, c }(2) | C, C++, Lua, Mathematica |
#(a, b, c) | Dylan |
#(a b c)(3) | Smalltalk |
{ a. b. c } | Squeak |
[ a ; b ; c ] | F#, OCaml |
[ a b c ] | Logo, Oz, Rebol |
({ a, b, c }) | Pike |
'(a b c) | Common Lisp, Emacs Lisp, Scheme |
<< a, b, c >> | Eiffel |
list(a, b, c) | Io |
list | Common Lisp, Dylan, Emacs Lisp, Scheme, Tcl |
array(a, b, c) | PHP |
new t[] { a, b, c } | C# |
new[] { a, b, c } | C#3 |
new List<t> { a, b, c} | C#3 |
Array(a, b, c)(4) | JavaScript |
[NSArray arrayWithObjects:a, b, c, nil] | Objective-C |
set l a b c | FishShell |
- a - b - c | YAML |
[]t{a, b, c} | Go |
a[i] | B, BourneShell, C, C#, C++, CoffeeScript, Dylan, E, FishShell, Go, Java, JavaScript, KornShell, Lua, Maple, merd, Modula-3, MSH, Pascal, Perl, Perl6, PHP, Pike, Python, Ruby, Vimscript |
a*[i] or a!i or a*(i) depending on the version | BCPL |
a[[i]] | Mathematica |
a[i]:default | YCP |
a(i) | Ada, Matlab |
a:i | Pliant |
a/:i | Rebol |
a.(i) | F#, OCaml |
a.[i] | F# |
a !! i | Haskell, Mercury |
a @ i | Eiffel |
a i get(5) | PostScript |
a at(i) | Io |
at(6) | C++, Smalltalk |
lindex | Tcl |
nth | Common Lisp, Emacs Lisp, OCaml |
Nth | Oz |
aref | Common Lisp, Emacs Lisp |
nth0 / nth1 | Prolog |
list-ref / vector-ref | Scheme |
element | Dylan |
slice | Ruby |
node[i] | XPath |
objectAtIndex | Objective-C |
item | Logo |
a i cells + @ (for write access: o a i cells + ! | Forth |
return the new list (no side-effect)
: | Haskell, merd |
:: | F#, OCaml, SML |
| | Oz |
[ e | l ] | Erlang, Prolog |
[e l[]] | Maple |
[e l] | Matlab |
cons | Common Lisp, Emacs Lisp, Scheme |
pair | Dylan |
fput | Logo |
Prepend | Ada, Mathematica |
side-effect
unshift | CoffeeScript, JavaScript, Perl, Perl6, Ruby |
prepend | YCP |
push_front | C++ |
addFirst | Smalltalk |
insert | Rebol |
put_first | Eiffel |
push | Common Lisp, Io |
array_unshift | PHP |
PrependTo | Mathematica |
return the new list (no side-effect)
linsert l i e | Tcl |
Insert | Ada, Mathematica |
side-effect
[a insertObject:e atIndex:i] | Objective-C |
a.insert(i, e) | Python, Ruby |
a insertAt(e, i) | Io |
a add: e beforeIndex: i / a add: e afterIndex: i | Smalltalk |
splice(@a, $i, 0, $e) | Perl |
return the new list (no side-effect)
[l e] | Matlab |
push | merd |
arrayByAddingObject | Objective-C |
lput | Logo |
linsert l end e | Tcl |
Append | Ada, Mathematica |
side-effect
push | CoffeeScript, JavaScript, Perl, Perl6, Ruby |
push_back | C++ |
append | Go, Io, Pliant, Python, Rebol |
AppendTo | Mathematica |
lappend | Tcl |
+= | Pliant |
add | Java, Smalltalk, YCP |
put_last | Eiffel |
array_push | PHP |
addObject | Objective-C |
head | Haskell |
Head | F# |
hd | F#, OCaml |
car | Common Lisp, Emacs Lisp, Scheme |
first | Eiffel, Io, Logo, Pliant, Rebol, Smalltalk |
First(7) | Mathematica |
First_Element | Ada |
iterator
head | Beta |
begin | C++ |
First | Ada |
tail | Haskell |
Tail | F# |
tl | F#, OCaml |
cdr | Common Lisp, Emacs Lisp, Scheme |
Rest | Mathematica |
butfirst | Logo |
allButFirst | Smalltalk |
l[1:] | Go, Python |
a(2:end) | Matlab |
L = [_|ButFirst] | Prolog |
lrange l 1 end | Tcl |
last | E, Eiffel, Haskell, Io, Logo, Pliant, Prolog, Rebol, Scheme, Smalltalk |
Last | Mathematica, Oz |
lastObject | Objective-C |
a[-1] | Perl, Pike, Python, Ruby |
a(end) | Matlab |
node[last()] | XPath |
(car (last l)) | Common Lisp, Emacs Lisp |
lindex l end | Tcl |
Last_Element | Ada |
l[len(l)-1:] | Go |
iterator
Last | Ada |
Most | Mathematica |
shift | CoffeeScript, JavaScript, Perl, Perl6, Ruby |
shift! | merd |
pop | Common Lisp, Logo |
removeFirst | Io, Smalltalk |
array_shift | PHP |
pop | CoffeeScript, E, Io, JavaScript, Perl, Perl6, Python, Ruby |
pop! | merd |
array_pop | PHP |
removeLast | Io, Smalltalk |
dequeue | Logo |
each | merd, Pliant, Ruby |
for v in l ... | CoffeeScript, E, Maple, Ruby |
for v in l: ... | Python |
for v in l; do ...; done | BourneShell |
for v in l do ... | F# |
for v in l; ...; end | FishShell |
for (v in l) ... | Awk, Dylan |
for (var v in l) { ... } | JavaScript |
For Each v in l ... Next | Visual Basic |
for v in range loop .. end loop | Ada |
for | Perl |
foreach | Logo, Lua, Perl, PHP, Pike, Rebol, Tcl |
foreach (t v in l) ... | C# |
foreach (v in l) ... | C#3 |
foreach ($v in l) ... | MSH |
foreach(t v, l, { ... }) | YCP |
l foreach(v, ...) | Io |
for_each | C++ |
for-each | Scheme |
forall | PostScript, Prolog |
ForAll | Oz |
iter | F#, OCaml |
do | Smalltalk |
do_all | Eiffel |
app | SML |
mapc | Emacs Lisp |
mapM_ | Haskell |
Scan | Mathematica |
(dolist (v l) ...) (loop for v in l do ...) mapc | Common Lisp |
list.iterate (# do current ... #) | Beta |
l.Iterate(...) | F# |
Iterate | Ada |
for i, v := range l {...} | Go |
map | Dylan, F#, Haskell, Io, Maple, Mercury, merd, OCaml, Perl, Pike, Python, Ruby, Scheme, SML |
Map | F#, Mathematica, Oz |
mapcar | Common Lisp, Emacs Lisp |
maplist | Prolog, YCP |
sublist | Prolog |
map / map.se | Logo |
for-each | XSLT |
foreach or selected | MSH |
collect | Ruby, Smalltalk |
transform | C++ |
array_map | PHP |
/@ | Mathematica |
[ f x | x <- l ](8) | Haskell |
[ f(x) for x in l ](8) | Python |
magical: sin(x) computes sin on each element | Matlab |
map2 | F#, OCaml |
zipWith | Haskell |
Zip | Maple, Oz |
map | Dylan, Logo, Python, Scheme |
map.se | Logo |
mapcar | Common Lisp |
maplist2 | Prolog |
l1 with: l2 collect: ... | Smalltalk |
transform | C++ |
ListPair.map | SML |
magical: a binary function or operator is appliied on each element | Matlab |
find | C++, Common Lisp, F#, Haskell, merd, OCaml, Rebol, Ruby, Scheme-SRFI1, SML, YCP |
Find | Ada |
find_if | C++ |
find-if | Common Lisp |
first(9) | Perl |
detect | Ruby, Smalltalk |
search | Pike |
ListTools[Search] | Maple |
lsearch -exact | Tcl |
index | Python |
indexOf | Io |
indexOfObject, indexOfObjectIdenticalTo | Objective-C |
find(a == 3) | Matlab |
Position | Mathematica |
matching
find_all | F#, OCaml, Ruby |
filter | F#, Haskell, Mercury, merd, OCaml, Pike, Python, Scheme-SRFI1, SML, YCP |
filter! | Scheme-SRFI1 |
Filter | Oz |
grep | Perl, Perl6 |
where | MSH |
select | Io, Maple, Ruby, Smalltalk |
Select / Case | Mathematica |
selectInPlace | Io |
remove-if-not delete-if-not | Common Lisp |
choose | Dylan |
array_filter | PHP5 |
[ x | x <- l, p x ](8) | Haskell |
[ x for x in l if p(x) ](8) | Python |
a(a == 3) | Matlab |
non matching
remove-if delete-if | Common Lisp |
reject | Ruby |
partition | F#, Haskell, merd, OCaml, Ruby, Scheme-SRFI1, SML |
partition! | Scheme-SRFI1 |
Partition | Oz |
in 2 based on a predicate
break | Haskell |
span | Haskell |
into sublists delimited by elements matching a predicate
split-sequence(10) | Common Lisp |
ListTools[Split] | Maple |
into a list of lists of same value
group | Haskell |
Split | Mathematica |
into sublists based on a predicate
groupBy | Haskell |
Split | Mathematica |
member? | Dylan, merd, Ruby |
include? | Ruby |
mem | F#, OCaml |
member | Common Lisp, Prolog, Scheme |
Member | Oz |
MemberQ | Mathematica |
memq memv | Scheme |
memberp / member? | Logo |
contains | E, Io, YCP |
containsObject | Objective-C |
in | CoffeeScript, JavaScript, Python, SQL92, Tcl8.5 |
in_array | PHP |
includes | Smalltalk |
elem | Haskell, Mercury |
has | Eiffel |
has_value | Pike |
ismember | Matlab |
/elt/ | GNU-sed |
any(11) | Haskell, Matlab, Mercury, Python, Scheme-SRFI1 |
any? | Dylan, Ruby |
anySatisfy | Smalltalk |
exists | F#, OCaml, SML |
exists? | merd |
some | Common Lisp |
Some | Oz |
ormap | Maple |
detect | Io |
all(11) | Haskell, Mercury, Python, SML |
All | Oz |
all? | merd, Ruby |
allSatisfy | Smalltalk |
every | Common Lisp, Scheme-SRFI1 |
every? | Dylan |
for_all | F#, OCaml |
andmap | Maple |
min / max | Common Lisp, Eiffel, Io, Java, Maple, Matlab, Perl6, PHP5, Pike, Prolog, Python, Ruby, Scheme, Smalltalk |
Min / Max | Mathematica |
minimum / maximum | Haskell, Mercury, merd |
minimum-of / maximum-of | Rebol |
min minstr / max maxstr(9) | Perl |
min_element / max_element | C++ |
join(s, l) | Perl, Perl6, PHP |
String.Join(s, l) | C# |
s.join(l) | Python |
l.join(s) | CoffeeScript, JavaScript, Perl6, Ruby |
l asStringWith: s | Smalltalk |
join l s | Tcl |
implode(s, l) | PHP |
ListTools[Join] | Maple |
rjoin | E |
join | Io |
concat | F#, OCaml |
strcat | Matlab |
concat_atom | Prolog |
l * s | Pike, Ruby |
(mapconcat 'identity l s) | Emacs Lisp |
componentsJoinedByString | Objective-C |
intercalate | Haskell |
StringJoin @@ Riffle[l, s] | Mathematica |
strings.Join | Go |
size | C++, Dylan, E, Io, Java, Matlab, merd, Pliant, Ruby, Scilab, Smalltalk, YCP |
sizeof | Pike |
length | C#, CoffeeScript, Common Lisp, Emacs Lisp, F#, Haskell, Java, JavaScript, Matlab, Mercury, OCaml, PostScript, Prolog, Ruby, Scheme, SML |
Length | Ada, F#, Mathematica, Oz |
length? | Rebol |
len | Python, Vimscript |
llength | Tcl |
$LENGTH | MUMPS |
elems | Perl6 |
getn | Lua |
count | Eiffel, FishShell, Objective-C, PHP, SQL92, XPath |
numel | Matlab |
scalar @l | Perl |
nops | Maple |
# | Lua |
len(l) | Go |
each_with_index | merd, Ruby |
enumerate(l) | Python |
foreach($l as $i => $v) | PHP |
a foreach(i, e, ...) | Io |
for i => v in l | E |
for (v in l, i from 0) ... end | Dylan |
forAllInd | Oz |
foreachi | Lua |
foreach(l; typ0 i; typ1 v) { ... } | Pike |
withIndexDo | Squeak |
iteri | F#, OCaml |
IterateIndexed | F# |
MapIndexed | Mathematica |
(loop for v in l as i upfrom 0 do ...) | Common Lisp |
for v,i in l ... | CoffeeScript |
for i, v := range l {...} | Go |
uniq | merd, Perl6, Pike, Ruby |
uniq! | Ruby |
uniq2 | Pike |
unique(12) | C++, Io, Matlab, Rebol |
nub | Haskell |
array_unique | PHP |
ListTools[MakeUnique] | Maple |
delete-duplicates | Common Lisp, Scheme-SRFI1 |
delete-duplicates! | Scheme-SRFI1 |
remove-duplicates | Common Lisp, Dylan |
lsort -unique | Tcl |
toset | YCP |
distinct | SQL92 |
set | Python |
Union | Mathematica |
sort(13) | C#, C++, CoffeeScript, Common Lisp, E, Eiffel, F#, Haskell, Io, Java, JavaScript, Lua, Maple, Matlab, merd, OCaml, Perl, Perl6, PHP, Pike, Prolog, Python, Rebol, Ruby, Scheme, XSLT, YCP |
sort! | Ruby |
sorted | Python |
Sort | Mathematica, Oz |
sort_by | merd, Ruby |
sortBy | Haskell, Io, Smalltalk |
order by | SQL92 |
lsort | Tcl |
asort | Awk |
sort-object | MSH |
sortedArrayUsingSelector, sortUsingSelector | Objective-C |
predsort / keysort / mergesort | Prolog |
reverse | C++, CoffeeScript, Common Lisp, Dylan, Emacs Lisp, Haskell, Io, Java, JavaScript, Logo, Mercury, merd, Perl, Perl6, Pike, Prolog, Python, Rebol, Ruby, Scheme |
Reverse | C#, Mathematica, Oz |
reversed | Python, Smalltalk |
reverse_copy | C++ |
rev | F#, OCaml, SML |
Reverse_Elements | Ada |
lreverse | Tcl8.5 |
array_reverse | PHP |
ListTools[Reverse] | Maple |
fliplr flipud... | Matlab |
l[::-1] | Python |
combine | F#, OCaml |
zip | F#, Haskell, Maple, merd, Perl6, Python, Ruby, Scheme-SRFI1, SML |
pairlis(14) | Common Lisp |
transpose | Ruby |
Transpose | Mathematica |
[a b] | Matlab |
split | F#, OCaml |
unzip | F#, Haskell, merd, SML |
unzip2 | Scheme-SRFI1 |
transpose | Ruby |
Transpose | Mathematica |
zip(*l) | Python |
a(1,:), a(2,:) | Matlab |
lookup | Haskell |
assoc | Common Lisp, Emacs Lisp, F#, OCaml, Ruby, Scheme |
assq | Emacs Lisp, Scheme |
assv | Scheme |
get_assoc | Prolog |
select | Rebol |
a.(e) | Matlab |
a[e] | Maple |
gprop | Logo |
/. | Mathematica |
to_a | Ruby |
toArray | Java |
asArray | Smalltalk |
to_list | merd |
list | Python |
map-as(<list>, bag) | Dylan |
[a.(:)] | Matlab |
array get | Tcl |
foldl | Haskell, Maple, Mercury, merd, SML |
FoldL | Oz |
fold_left | OCaml |
fold | F#, Scheme-SRFI1 |
Fold | Mathematica |
reduce(15) | Common Lisp, Dylan, Io, Perl, Perl6, Pike, Python |
inject | Ruby |
inject into | Smalltalk |
foldr | Haskell, Maple, Mercury, merd, SML |
FoldR | Oz |
fold-right | Scheme-SRFI1 |
fold_right | OCaml |
foldBack | F# |
rreduce | Pike |
(reduce f '(e1 e2 ... en) :from-right t :initial-value init) | Common Lisp |
reverseReduce | Io |