seq | YAML |
a list | OCaml |
[a] | Haskell |
a[] | C# |
List | Pliant |
+ | E, Eiffel, merd, Pike, Python, Ruby |
, | Smalltalk |
, (60) | Perl |
@ | OCaml, SML |
++ | Haskell |
||| | Icon |
array_merge | PHP |
merge | YCP |
concat | JavaScript, Tcl |
concatenate | Dylan |
append nconc | Common Lisp, Emacs Lisp |
append | Beta, Rebol, Scheme |
Append | Oz |
arrayByAddingObjectsFromArray | Objective-C |
one level depth
concat | Haskell, Mercury, SML |
flatten | merd, OCaml, YCP |
Flatten | Oz |
eval concat | Tcl |
recursive
flatten | Pike, Ruby |
[ a, b, c ] | E, Haskell, JavaScript, merd, Perl, PostScript, Prolog, Python, Ruby, SML, YAML, YCP |
( a, b, c ) | Perl |
{ a, b, c } (61) | C, C++, Lua |
#(a, b, c) | Dylan |
#(a b c) (62) | Smalltalk |
{ a. b. c } | Squeak |
[ a ; b ; c ] | OCaml |
[ a b c ] | Oz, Rebol |
({ a, b, c }) | Pike |
'(a b c) | Common Lisp, Emacs Lisp, Scheme |
<< a, b, c >> | Eiffel |
list | Common Lisp, Dylan, Emacs Lisp, Scheme, Tcl |
new t[] { a, b, c } | C# |
new[] { a, b, c } | C#3 |
new List<t> { a, b, c} | C#3 |
Array(a, b, c) (63) | JavaScript |
[NSArray arrayWithObjects:a, b, c, nil] | Objective-C |
- a - b - c |
YAML |
a[i] | B, C, C#, C++, Dylan, E, Java, JavaScript, Lua, merd, Modula-3, Pascal, Perl, PHP, Pike, Python, Ruby |
a*[i] or a!i or a*(i) depending on the version | BCPL |
a[i]:default | YCP |
a(i) | Ada |
a:i | Pliant |
a/:i | Rebol |
a.(i) | OCaml |
a !! i | Haskell, Mercury |
a @ i | Eiffel |
a i get (64) | PostScript |
at (65) | Smalltalk |
at (55) | C++ |
lindex | Tcl |
Nth | Oz |
nth / aref | Common Lisp, Emacs Lisp |
list-ref / vector-ref | Scheme |
element | Dylan |
slice | Ruby |
node[i] | XPath |
objectAtIndex | Objective-C |
return the new list
: | Haskell, merd |
:: | OCaml, SML |
| | Oz |
[ e | l ] | Erlang, Prolog |
cons | Common Lisp, Emacs Lisp, Scheme |
pair | Dylan |
side-effect
unshift | JavaScript, Perl, Perl6, Ruby |
prepend | YCP |
push_front | C++ |
addFirst | Smalltalk |
insert | Rebol |
put_first | Eiffel |
push | Common Lisp |
array_unshift | PHP |
return the new list
side-effect
[a insertObject:e atIndex:i] | Objective-C |
return the new list
push | merd |
arrayByAddingObject | Objective-C |
side-effect
push | JavaScript, Perl, Perl6, Ruby |
push_back | C++ |
append | Pliant, Python, Rebol |
+= | Pliant |
add | Java, Smalltalk, YCP |
put_last | Eiffel |
array_push | PHP |
addObject | Objective-C |
head | Haskell |
hd | OCaml |
car | Common Lisp, Emacs Lisp, Scheme |
first | Eiffel, Pliant, Rebol, Smalltalk |
iterator
head | Beta |
begin | C++ |
tail | Haskell |
tl | OCaml |
cdr | Common Lisp, Emacs Lisp, Scheme |
allButFirst | Smalltalk |
last | E, Eiffel, Haskell, Pliant, Rebol, Scheme, Smalltalk |
Last | Oz |
lastObject | Objective-C |
a[-1] | Perl, Pike, Python, Ruby |
node[last()] | XPath |
(car (last lst)) | Common Lisp, Emacs Lisp |
iterator
shift | JavaScript, Perl, Perl6, Ruby |
shift! | merd |
pop | Common Lisp |
removeFirst | Smalltalk |
array_shift | PHP |
pop | E, JavaScript, Perl, Perl6, Python, Ruby |
pop! | merd |
array_pop | PHP |
removeLast | Smalltalk |
each | merd, Pliant, Ruby |
for in | E, JavaScript, Python, Ruby |
for | Perl |
foreach | Lua, Perl, PHP, Pike, Rebol, Tcl |
foreach (t v in l) ... | C# |
foreach (v in l) ... | C#3 |
foreach(t v, l, { ... }) | YCP |
for_each | C++ |
for-each | Scheme |
forall | PostScript |
ForAll | Oz |
iter | OCaml |
do | Smalltalk |
do_all | Eiffel |
app | SML |
mapc | Emacs Lisp |
mapM_ | Haskell |
for (v in l) ... | Awk, Dylan |
For Each v in l ... Next | Visual Basic |
for v in range loop .. end loop | Ada |
(dolist (v l) ...) (loop for v in l do ...) mapc | Common Lisp |
list.iterate (# do current ... #) | Beta |
map | Dylan, Haskell, Mercury, merd, OCaml, Perl, Pike, Python, Ruby, Scheme, SML |
Map | Oz |
mapcar | Common Lisp, Emacs Lisp |
maplist | YCP |
for-each | XSLT |
collect | Ruby, Smalltalk |
transform | C++ |
array_map | PHP |
[ f x | x <- l ] (66) | Haskell |
[ f(x) for x in l ] (66) | Python |
map2 | OCaml |
zipWith | Haskell |
Zip | Oz |
map | Dylan, Python, Scheme |
mapcar | Common Lisp |
l1 with: l2 collect: ... | Smalltalk |
transform | C++ |
ListPair.map | SML |
find | Haskell, merd, OCaml, Rebol, Ruby, Scheme-SRFI1, SML, YCP |
find find_if | C++ |
find find-if | Common Lisp |
first (16) | Perl |
detect | Ruby, Smalltalk |
search | Pike |
lsearch | Tcl |
indexOfObject, indexOfObjectIdenticalTo | Objective-C |
find_all | OCaml, Ruby |
filter | Haskell, Mercury, merd, OCaml, Pike, Python, Scheme-SRFI1, SML, YCP |
filter! | Scheme-SRFI1 |
Filter | Oz |
grep | Perl |
select | Ruby, Smalltalk |
remove-if delete-if | Common Lisp |
reject | Ruby |
choose | Dylan |
[ x | x <- l, p x ] (66) | Haskell |
[ x for x in l if p(x) ] (66) | Python |
foldl | Haskell, Mercury, merd, SML |
FoldL | Oz |
fold_left | OCaml |
fold | Scheme-SRFI1 |
reduce | Common Lisp, Dylan, Pike, Python |
reduce (16) | Perl |
inject | Ruby |
inject into | Smalltalk |
foldr | Haskell, Mercury, merd, SML |
FoldR | Oz |
fold-right | Scheme-SRFI1 |
fold_right | OCaml |
rreduce | Pike |
(reduce f '(e1 e2 ... en) :from-right t :initial-value init) | Common Lisp |
partition | Haskell, merd, OCaml, Ruby, Scheme-SRFI1, SML |
partition! | Scheme-SRFI1 |
Partition | Oz |
split-sequence (67) | Common Lisp |
member? | Dylan, merd, Ruby |
include? | Ruby |
mem | OCaml |
member | Common Lisp |
member memq memv | Scheme |
Member | Oz |
contains | E, YCP |
containsObject | Objective-C |
in | JavaScript, Python, SQL92 |
in_array | PHP |
includes | Smalltalk |
elem | Haskell, Mercury |
has | Eiffel |
has_value | Pike |
any | Haskell, Mercury, Scheme-SRFI1 |
any? | Dylan, Ruby |
anySatisfy | Smalltalk |
exists | OCaml, SML |
exists? | merd |
some | Common Lisp |
Some | Oz |
all | Haskell, Mercury, SML |
All | Oz |
all? | merd, Ruby |
allSatisfy | Smalltalk |
every | Common Lisp, Scheme-SRFI1 |
every? | Dylan |
for_all | OCaml |
min / max | Common Lisp, Eiffel, Java, Pike, Python, Ruby, Scheme, Smalltalk |
minimum / maximum | Haskell, Mercury, merd |
minimum-of / maximum-of | Rebol |
min minstr / max maxstr (16) | Perl |
min_element / max_element | C++ |
join | JavaScript, Perl, Perl6, PHP, Python, Rebol, Ruby |
Join | C# |
rjoin | E |
concat | OCaml |
l * glue | Pike, Ruby |
(macpconcat 'identity l glue) | Emacs Lisp |
componentsJoinedByString | Objective-C |
size | C++, Dylan, E, Java, merd, Pliant, Ruby, Smalltalk, YCP |
sizeof | Pike |
length | C#, Common Lisp, Emacs Lisp, Haskell, Java, JavaScript, Mercury, OCaml, PostScript, Prolog, Ruby, Scheme, SML |
Length | Oz |
length? | Rebol |
len | Python |
llength | Tcl |
getn | Lua |
count | Eiffel, Objective-C, PHP, SQL92, XPath |
scalar @l | Perl |
each_with_index | merd, Ruby |
foreach($l as $i => $v) | PHP |
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 |
(loop for v in l as i upfrom 0 do ...) | Common Lisp |
uniq | merd, Ruby |
uniq or uniq2 | Pike |
unique | Rebol |
unique (68) | C++ |
nub | Haskell |
array_unique | PHP |
delete-duplicates delete-duplicates! | Scheme-SRFI1 |
remove-duplicates | Dylan |
remove-duplicates delete-duplicates | Common Lisp |
lsort -unique | Tcl |
toset | YCP |
distinct | SQL92 |
sort | C#, C++, Common Lisp, E, Eiffel, Haskell, Java, JavaScript, Lua, merd, OCaml, Perl, PHP, Pike, Python, Rebol, Ruby, XSLT, YCP |
sort (69) | Scheme |
sorted | Python |
Sort | Oz |
sort_by | merd, Ruby |
sortBy | Haskell, Smalltalk |
order by | SQL92 |
lsort | Tcl |
asort | Awk |
sortedArrayUsingSelector, sortUsingSelector | Objective-C |
reverse | C++, Common Lisp, Dylan, Emacs Lisp, Haskell, Java, JavaScript, Mercury, merd, Perl, Perl6, Pike, Python, Rebol, Ruby, Scheme |
Reverse | C#, Oz |
reversed | Smalltalk |
reverse_copy | C++ |
rev | OCaml, SML |
array_reverse | PHP |
combine | OCaml |
zip | Haskell, merd, Perl6, Python, Ruby, Scheme-SRFI1, SML |
pairlis (70) | Common Lisp |
transpose | Ruby |
split | OCaml |
unzip | Haskell, merd, SML |
unzip2 | Scheme-SRFI1 |
transpose | Ruby |
zip(*l) | Python |
lookup | Haskell |
assoc | Common Lisp, OCaml, Ruby |
assoc assq | Emacs Lisp |
assoc assq assv | Scheme |
select | Rebol |
to_a | Ruby |
toArray | Java |
asArray | Smalltalk |
to_list | merd |
map-as(<list>, bag) | Dylan |