A one-page comparison of several programming languages

Adapted from Pascal Rigaux's syntax-across-languages

#ThemeCategoryCriterionBourneShellCoffeeScriptJuliaPerlPHPPythonRubyYAMLC++JavaJavaScriptMatlabVisual BasicCSSHTML
1Mathematicstype nameintegersintegerint, long(124)Integer, FixNum, BigNumshort, int, longInt, Integer, Int8, Int16, Int32, Int64
2Mathematicstype namefloating pointNumberfloatfloat, decimal.DecimalFloatfloat, doubleNumber
3Mathematicsnumbers syntaxintegers100010001000100010001000100010001000100010001000, 1000.
4Mathematicsnumbers syntaxintegers in base 2, octal and hexadecimal707, 0xf0b1, 0o7, 0xf07, 0xf0b1, 07, 0xf(126)07, 0xf07, 0xf0xf#2r1, #8r7, #16rf
5Mathematicsnumbers syntaxinteger thousand-separator1_000, 10_00, 100_01_000, 10_00, 100_0
6Mathematicsnumbers syntaxfloating point1000, 1000.0, 1E3(127)1000, 1000.0, 1E3(127)1000.0, 1E31000.0, 1E31000., 1E31000., 1E31000., 1E31000., 1E3
7Mathematicsnumbers syntaxaddition / subtraction / multiplication / division+ / - / * / /+ / - / * / /+ / - / * / /+ / - / * / /+ / - / * / /+ / - / * / /+ / - / * / /+ / - / * / /+ / - / * / /+ / - / * / /
8Mathematicsnumbers syntaxexponentiation (power)^pow**powpow****powpowpow**, ^ and ^^(130)
9Mathematicsnumbers syntaxnegation------------
10Mathematicsnumbers syntaxrandom numberRandom valuemt_randrandrandRandom ran = new Random();\nran.Next(...);Random value
11Mathematicsnumbers syntaxseed the pseudo random generatorRandom setSeedsrandsrandsrandRandom setSeed
12Mathematicsoperator priorities and associativitiesaddition vs multiplicationmathematicalmathematicalmathematicalmathematicalmathematicalmathematicalmathematicalmathematicalmathematical
13Mathematicsoperator priorities and associativitiesexponentiation vs negation (is -3^2 equal to 9 or -9)mathematicalmathematicalmathematical
14Mathematicsoperator priorities and associativitiessquare root / e-exponential / absolute valuesqrt / exp /sqrt / exp / abssqrt / exp / abssqrt / exp / abssqrt / exp / abssqrt,isqrt / exp / abssqrt / exp / abssqrt / exp / abssqrt / exp / abs
15Mathematicstrigonometrybasicsin / cos /sin / cos / tansin / cos / tansin / cos / tansin / cos / tansin / cos / tansin / cos / tansin / cos / tansin / cos / tan
16Mathematicstrigonometryinverseasin / acos / atan(134)asin / acos / atan(134)asin / acos / atan(134)asin / acos / atan(134)asin / acos / atan(134)asin / acos / atan(134)asin / acos / atan(134)
17Mathematicslogarithmbase elogloglogloglogloglogloglog
18Mathematicslogarithmbase 10log10log10log10log10log10log10log10
19Mathematicslogarithmbase 2log-10 / log-2math.Log2
20Mathematicslogarithmeuclidean division (both quotient and modulo)divmoddivMod
21Mathematicslogarithmmodulo of -3 / 2 is 1%modulo%
22Mathematicslogarithmmodulo of -3 / 2 is -1rem%mod%%%%
23Mathematicslogarithmtruncate / round / floor / ceilint / round / floor / ceil/ round / floor / ceilto_i, Integer() / round / floor / ceil/ round / floor / ceilingtrunc / round / floor / ceil/ round / floor / ceilint / round / floor / ceil
24Mathematicsbitwise operatorsand / or / xor& / | / ^& / | / ^& / | / ^& / | / ^& / | / ^& / | / ^& / | / ^
25Mathematicsbitwise operatorsbitwise inversion~~~~~
26Mathematicsbitwise operatorsleft shift / right shift / unsigned right shift<< / >> / >>><< / >><< / >><< / >><< / >> / >>><< / >> / >>>
27Threads#Threadsthread definitionclass class_name(threading.Thread) {[override run method] }class class_name(threading.Thread) {[override run method] }class class_name extends Thread {[override run method] }
28Threads#Threadsthread creationThread createThread(...)set t [thread create {code}]
29Threads#Threadsthread object creationclass_name MyThread = new class_name()
30Threads#Threadsstarting / stopping threadsthread send $t {script}start() / stop()(141)
31Threads#Threadspassing data directly between threadscommon variables are copied at thread creation, in abscence of a share statementcall any public method
32Threads#Threadsterminating thread communication due to a time-out
33Thread Synchronization#Thread SynchronizationDefining a Synchronized Shared Resourcethread::mutexsynchronize (this){ ... }
34Thread Synchronization#Thread SynchronizationSynchronized Writing to a shared resourceObject_Name.SetMethod(Parms)
35Thread Synchronization#Thread SynchronizationSynchronized Reading of a Shared ResourceObject_Name.GetMethod()
36Thread Synchronization#Thread SynchronizationMonitor Syntax
37Joining Another Thread#Joining Another ThreadSuspending a thread until another thread completesOtherThread.join()OtherThread.join()
38Joining Another Thread#Joining Another ThreadSuspending a Thread Until Another Thread Establishes An Internal State
39Thread Prioritization#Thread PrioritizationSelecting a Prioritization Model
40Thread Prioritization#Thread PrioritizationEstablishing a base thread priority
41Thread Prioritization#Thread PrioritizationChanging Thead PrioritysetPriority(newPriority);
42Thread-safe sharing of data without synchronization#Thread-safe sharing of data without synchronizationEnsuring access is atomic
43Thread-safe sharing of data without synchronization#Thread-safe sharing of data without synchronizationEnsuring access is always via a local copy of the shared data
44Variouscommentinguntil end of line####//###//////%'
45Variouscommentingnestable#= ... =##[ ... ]
46Variouscommentingnon nestable/* ... *//* ... *//* ... *//* ... */<!-- ... -->
47Variousdocumentation commentuntil end of line//////
48Variousdocumentation commentnon nestable/** ... */(3)/** ... */(3)/** ... */(3)
49Variousdocumentation commentinformation about the current line and file__LINE__ __FILE____LINE__ __FILE____LINE__ __FILE__Thread.currentThread().getStackTrace()[1].getLineNumber();\nThread.currentThread().getStackTrace()[1].getFileName();Thread.currentThread().getStackTrace()[1].getLineNumber();\nThread.currentThread().getStackTrace()[1].getFileName();
50Varioustokenscase-sensitivity (keywords, variable identifiers...)case-sensitivecase-sensitivecase-sensitivecase-sensitivecase-sensitive: variables\ncase-insensitive: keywords, functions, constants...case-sensitivecase-sensitivecase-sensitivecase-sensitivecase-sensitivecase-sensitivecase-insensitivecase-insensitive
51Varioustokenswhat is the standard way for scrunching together multiple wordscamelCaseCamelCase or camelCaseCamelCase for modules, ALL_CAPS for constants, unclear for functions / variablesCamelCase for modules, ALL_CAPS for constants, unclear for functions / variablesCamelCase for classes, underscores for methodsCamelCase for modules and classes, ALL_CAPS for constants, underscores for functions, variables, ...CamelCase or camelCaseusually underscoresCamelCase or camelCaseCamelCase or camelCase
52Varioustokensvariable identifier regexp[_a-zA-Z0-9]+[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*[_a-zA-Z0-9]+[_a-zA-Z][_a-zA-Z0-9]*[_a-zA-Z][_a-zA-Z0-9]*[_a-z][_a-zA-Z0-9]*[a-zA-Z][_a-zA-Z0-9]*[_a-zA-Z][_a-zA-Z0-9]*[_a-zA-Z$][_a-zA-Z0-9$]*[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*anything without a space and is not a number[_a-z][_a-zA-Z0-9']*
53Varioustokensfunction identifier regexp (if different from variable identifier regexp)[A-Z][_a-zA-Z0-9]*(7)
54Varioustokenskeyword regexp (if different from variable identifier regexp)
55Varioustokenstype regexp (if different from variable identifier regexp)
56Varioustokensconstant regexp (if different from variable identifier regexp)
57Varioustokensbreaking lines (useful when end-of-line and/or indentation has a special meaning)\\nothing needednothing needed\nothing needednothing needednothing needednothing needednothing needed
58Variousvariable assignment or declarationassignment====is====_(8)set
59Variousvariable assignment or declarationdeclarationvarmy / our / tempglobal v1, v2global v1, v2t vt vvarflet labels defun defmethod defvar defparameter defsetf ..
60Variousvariable assignment or declarationboth:==set, variable:=
61Variousvariable assignment or declarationgrouping expressions( ... )( ... )( ... )( ... )( ... )begin ... end( ... )( ... )( ... )( ... )( ... )
62Variousvariable assignment or declarationblock (grouping statements, especially when statements are not expressions)( ... )(13)indentation{ ... }(13){ ... }indentationfoo ... end where foo in { if, do, ... }...{ ... }(13){ ... }(13){ ... }indentationindentation(13)
63Variousvariable assignment or declarationuse a block as a return value (when statements are not expressions)do
64Variousequality / inequalityshallowErr:510Err:510Err:510Err:510is / is notErr:510Err:510Err:510eq, eql
65Variousequality / inequalitydeepErr:510Err:510eqvErr:510Err:510Err:510equals
66Variousequality / inequalitycomparison-lt -gt -le -ge< > <= >=< > <= >=lt gt le ge< > <= >=< > <= >=< > <= >=< > <= >=< > <= >=< > <= >=< > <= >=< > <= >=
67Variousequality / inequalityreturns 3 values (i.e. inferior, equal or superior)cmpstrcmpcmpa <=> bstring comparecompareTocompareTo
68Variousequality / inequalityreturns 4 values (i.e. inferior, equal, superior or not comparable)compare
69Variousequality / inequalitymin / max (binary or more)min / maxmin minstr / max maxstr(22)min / maxmin / maxmin / max
70Variousequality / inequalityruntime evaluationCoffeeScript.eval(23)evalevalexeceval[...]
71Variousmanual memory allocationallocation
72Variousmanual memory allocationdeallocation
73Variousmanual memory allocationforce garbage collectionVM.garbageCollect()incremental garbage collection => not neededGC.startSystem.GC.Collect()System.gc()VM.garbageCollect()
74Functions#Functionsfunction callf a b ...f a, b, ...f(a,b,...)f a, b, ...f(a,b,...)f(a,b,...)f[a,b,...] or f.call(a,b,...)<xsl:call-template name=f>\n    <xsl:with-param name=a select=a/>\n    <xsl:with-param name=b select=b/>\n</xsl:call-template>f(a,b,...)f(a,b,...)f(a,b,...)f a b ...f(a,b,...)
75Functions#Functionswith no parameterff()f()&$f or $f->()f()f()f[] or f.call<xsl:call-template name=f>/f()f()f()f
76Functionspartial application (in the examples below, a normal call is f(a,b))
77Functionspartial application (in the examples below, a normal call is f(a,b))give the first argument&f.assuming(var_name => a)interp alias {} f_a {} f a
78Functionspartial application (in the examples below, a normal call is f(a,b))give the second argument&f.assuming(b => b)
79Functionspartial application (in the examples below, a normal call is f(a,b))give the first argument to operator >(>) a
80Functionspartial application (in the examples below, a normal call is f(a,b))give the second argument to operator >(> a)
81Functionspartial application (in the examples below, a normal call is f(a,b))function definitionf : procedure\n  ...\nreturn retvalsub f { ... }/f { ... } def<xsl:template name=f>\n    <xsl:param name=para1/>\n    <xsl:param name=para2/>\n    ...\n</xsl:template>
82Functionspartial application (in the examples below, a normal call is f(a,b))procedures
83Functionspartial application (in the examples below, a normal call is f(a,b))variable number of arguments(args...) -> ...one can use overloading on different number of argumentsone can use overloading on different number of arguments
84Functionspartial application (in the examples below, a normal call is f(a,b))predicates
85Functionspartial application (in the examples below, a normal call is f(a,b))anonymous function
86Functionsfunction return valuebreaks the control flowreturn(42)return(42)return(42)return(42)return(42)return(42)Exit Function / Exit Subreturn(42)return(42)return(42)return-from xxx
87Functionsfunction return valuefunction body is the resultno syntax needed(44)no syntax needed(44)no syntax needed(44)no syntax needed(44)
88Functionsfunction return valuesetting the result
89Functionsfunction return valuefunction called when a function is not defined (in dynamic languages)__noSuchMethod__(45)AUTOSCALAR, AUTOMETH, AUTOLOAD...method_missingunknownTryInvokeMember(46)
90Functionsfunction return valueruntime inspecting the caller informationcallcallercallerinfo levelcall
91Functionsfunction return valuefunction composition~
92Functionsfunction return valueidentity function
93Control Flow#Control Flowsequenceend-of-lineend-of-lineend-of-line;;end-of-lineend-of-lineend-of-line;;end-of-lineend-of-line(progn ...) (prog1 ...) (prog2 ...)>>
94Control Flow#Control Flowif_thenif c; then ... fiif c\n    ...if (c) ...c and ...if (c): ... endifif c: ...if c\n  ...\nend<xsl:if test=c>...</xsl:if>if (c) ...if (c) ...if (c) ...(if c ...)
95Control Flow#Control Flowif_then_elseif c; then b1; elif c2; then b2; else b3; fiif c\n  b1\nelse if c2\n  b2\nelse\n  b3c ? b1 : b2c ? b1 : b2c ? b1 : b2if c: \n  b1 \nelif c2:\n  b2 \nelse: \n  b3if c\n  b1\nelsif c2\n  b2\nelse\n  b3\nend<xsl:choose>\n    <xsl:when test=c> b1 </xsl:when>\n    <xsl:when test=c2> b2 </xsl:when>\n    <xsl:otherwise> b3 </xsl:otherwise>\n</xsl:choose>c ? b1 : b2c ? b1 : b2c ? b1 : b2(cond (c b1) (c2 b2) (t b3))
96Control Flow#Control Flowifnot_then (unless)if(c) not then(...)
97Control Flow#Control Flowmultiple selection (switch)select\n  when v1 ...\n  when v2 | v3 ...\n  otherwise ...\nenduse Switch;\nswitch ($val) {\n    case v1 { ... }\n    case v2 { ... }\n    else ...\n})(49)switch (val) { \n   case v1: ...; break; \n   case v2: case v3: ...; break; \n   default: ...;\n }Select val\n    Case v1\n        ...\n    Case v2, v3\n        ...\n    Case Else\n        ...\nEnd Selectswitch (val) { \n   case v1: ...; break; \n   case v2: case v3: ...; break; \n   default: ...;\n }switch (val) { \n   case v1: ...; break; \n   case v2: case v3: ...; break; \n   default: ...;\n }switch (val) { \n   case v1: ...; break; \n   case v2: case v3: ...; break; \n   default: ...;\n }(case val\n   ((v1) ...)\n   ((v2) ...)\n   (otherwise ...))case val of\n   v1 -> ...\n   v2 -> ...\n   _ -> ...
98Control Flowloopforever looploop(...)LOOP ... ENDlooploop(...)
99Control Flowloopwhile condition do somethingwhile c; do ...; donewhile c ...while (c) ...while (c) ...while c: ...while (c) ...Do While c \n    ...\nLoopwhile (c) ...while (c) ...while (c) ...(loop while c do ...)
100Control Flowloopdo something until conditionloop (# until ::< (# do c -> value #) do ... #)do ... until cdo ... while (!c)do ... while (!c)
101Control Flowloopfor each value in a numeric range, 1 increment (see also the entries about ranges)for (i = 1; i <= 10; i++) ...for (i = 1; i <= 10; i++) ...for ($i = 1; $i <= 10; $i++) ...1.upto(10) {|i| ... }For i = 1 To 10 ... Nextfor (int i = 1; i <= 10; i++) ...1 to(10) foreach(...)
102Control Flowloopfor each value in a numeric range, 1 decrementfor i in `seq 10 -1 1`; do ...; donefor i in [10..1] ...for (i = 10; i >= 1; i--) ...for ($i = 10; $i >= 1; $i--) ...10.downto(1) {|i| ... }For i = 10 To 1 Step -1 ... Nextfor (int i = 10; i >= 1; i--) ...10 to(1) foreach(...)
103Control Flowloopfor each value in a numeric range, free incrementfor (i = 1; i <= 10; i += 2) ...for (i = 1; i <= 10; i += 2) ...for ($i = 1; $i <= 10; $i += 2) ...(1..10).step(2) {|i| ... }For i = 1 To 10 Step 2 ... Nextfor (int i = 1; i <= 10; i += 2) ...1 to (9,2) foreach(...)
104Control Flowloopfor a la C (while + initialisation)for ((x = 0; x < 10; x++)); do ...; doneforforforforforfor
105Control Flowbreaking control flowreturning a valuereturn(42)return(42)return(42)return(42)return(42)return(42)Exit Function / Exit Subreturn(42)return(42)return(42)return-from xxx
106Control Flowbreaking control flowgoto (unconditional jump)gotogotogotogo throw
107Control Flowbreaking control flowcontinue / breakrestart / leavecontinue / breakcontinue / breakcontinue / breaknext / break(51)/ Exit Do, Exit Forcontinue / breakcontinue / breakcontinue / break
108Control Flowbreaking control flowredo / retryredo / retryredo/
109Control Flowexceptionthrowingthrowdiedieraiseraisereturn -codethrowthrowthrowerror
110Control Flowexceptioncatchingtry a catch (exn) ...try { a CATCH exn { ... } }try: a except exn: ...rescuecatchtry a catch (exn) ...try a catch (exn) ...try a catch (exn) ...try\n  a\ncatch\n  ...\nend
111Control Flowexceptioncleanup: code executed before leavingensurefinallyfinally
112Control Flowexceptionretrying: after catching an exception, tell the snippet to be re-run
113Control Flowexceptionresume execution where the exception took place
114Control Flowexceptioncall-with-current-continuation
115Types#Typesdeclarationtype n = tn = tn = ttypedef t nnewtype n = t
116Types#Typesannotation (or variable declaration):t vt vt vt vt v
117Typescastupcaststatic_cast<t>(e)(t) e(t) e
118Typescastdowncast (need runtime checking)dynamic_cast<t>(e)(t) e
119Typescastcomputed conversion (calls an internal or a user-defined function)t(e)make t e / to t e
120Typesmutability, constnesstype of a mutable valuemutability is the defaultmutability is the defaultmutability is the default
121Typesmutability, constnesstype of a constant valueconstness is the default
122Typesmutability, constnessspecial casesreadonly fields(57)final fields, parameters, local variables(57)
123Object Oriented & Reflexivity#Object Oriented & Reflexivitymethod invocationobject.method(para)object->method(para)object->method(para)object.method(para)object.method(para)object.method(para)object->method(para)object.method(para)
124Object Oriented & Reflexivity#Object Oriented & Reflexivitywith no parameterobject.method()object->methodobject.methodobject.method()object.methodobject.method()object.method()
125Object Oriented & Reflexivity#Object Oriented & Reflexivityobject creationnew class_name(...)class_name(...)class_name.new(...)class_name v(...)new class_name(...)
126Object Oriented & Reflexivity#Object Oriented & Reflexivityobject cloningo.clone()$o2 = $oo.clone(60)o2 = o(62)o.clone()
127Object Oriented & Reflexivity#Object Oriented & Reflexivitymanually call an object's destructordel, __del__delete
128Object Oriented & Reflexivity#Object Oriented & Reflexivityclass declarationclassclassclassstructclass
129Object Oriented & Reflexivity#Object Oriented & Reflexivitytesting class membershipis_aisinstanceis_a? kind_of?dynamic_castinstanceof
130Object Oriented & Reflexivity#Object Oriented & Reflexivityget the type/class corresponding to an object/instance/valuetypeofget_classclasstypeidtypeof
131Object Oriented & Reflexivity#Object Oriented & Reflexivitymethods availablegetMethodsget_class_methodsmethodsgetMethods
132Object Oriented & Reflexivity#Object Oriented & Reflexivityinheritanceclass child extends parentclass child is parent { ... }class child < parent endclass child : parentclass child extends parent
133Object Oriented & Reflexivity#Object Oriented & Reflexivityhas the methodhasSlotcanrespond_to?
134Object Oriented & Reflexivity#Object Oriented & Reflexivitycurrent instancethisthisfirst parameter(68)selfthisthis
135Object Oriented & Reflexivity#Object Oriented & Reflexivityaccessing parent methodsuper$o.SUPER::method(...)superbasesuper
136Object Oriented & Reflexivity#Object Oriented & Reflexivityaccessing child method
137PackagePackage, Modulepackage scope':::::..
138PackagePackage, Moduledeclaremodule P ... end<node xmlns=namespace> ... </node>namespace p { ... }package p;package p;
139PackagePackage, Moduleselective exportappend_featuresnamespace export name1attached to each name (public, private...)attached to each name (public, private...)
140Packageimporteverything into current namespaceusing namespace p;include or even extendnamespace import p *using namespace p;import p.*
141Packageimportselectivelyfrom p import name1, name2, ...namespace import p name1import p.name1; import p.name2
142Packageimportpackage (ie. load the package)require ppackage require pautomatically done(74)automatically done(74)
143Strings#Stringstype nameStringstringstringstrStringstringStringString
144Strings#Stringscharacter type namecharCharcharChar
145Strings#Stringscharacter zz'z''z''z'#\z
146Stringsstringswith no interpolation of variables<<'MARK' ... MARK'...'...q(...(...)...), q[...], q{...}, q<...>, q/.../'...''''...'''%q(...(...)...), %q[...], %q{...}, %q<...>, %q/.../............
147Stringsstringswith interpolation of variables... #{v} ... ... #$v ... ... #@v ... ... #@@v ...... #{v} ... interpolateqq(...(... $v ...)...), qq[...], qq{...}, qq<...>, qq/.../<<<MARK ... $v ... MARK%Q(...(... #{v} ...)...), %Q[...], %Q{...}, %Q<...>, %Q/.../... $v ...
148Stringsstringsend-of-line (without writing the real CR or LF character)\n\n\n\nvb_nl\n\n\n~%(78)
149Stringsstringsmulti-line...,\n...all strings allow multi-line stringsall strings allow multi-line strings..., {...}@...all strings allow multi-line strings
150Stringsstringsconvert something to a string (see also string interpolation) + e . e(string) estr, `e`, reprto_s, to_str, inspect, String()stringToString + e + e
151Stringsstringsserialize (marshalling)serializeMarshal.dump
152Stringsstringsunserialize (un-marshalling)doStringMarshal.load
153Stringsstringssprintf-likeputFormatStorable::retrievesprintf%formatsprintfformatformatsprintf
154Stringssimple printon stringsecho(84)displaywritelnconsoleechomprintln(83)writelnprintechom
155Stringssimple printon simple objectssay(83)puts -nonewline
156Stringssimple printon any objectswriteln(83)puts(85)WriteLine
157Stringssimple printprintf-likeputFormatprintfprintfprintf
158Stringssimple printstring equality & inequalityErr:510Err:510Err:510eq neErr:510Err:510equal?Err:510Err:510equalsErr:510
159Stringssimple printstring size${#v}lengthlengthstrlenlensizestring-lengthsizelengthlength
160Stringssimple printstring concatenation$a$b++..++concat+++++
161Stringssimple printduplicate n timesrepeatedxstr_repeat**string repeatrepeated
162Stringssimple printupper / lower case characterupCase / lowCasetoUpperCase / toLowerCasestrtoupper / strtolowerupper / lower(90)upcase / downcasestring toupper / string tolowertoupper / tolowertoUpperCase / toLowerCasetoUpperCase / toLowerCase
163Stringssimple printuppercase / lowercase / capitalized stringmakeLC / makeUCtoUpperCase / toLowerCasestrtoupper / strtolowerupcase / downcaseUCase / LCaseToUpper / ToLowertoUpperCase / toLowerCasetoUpperCase / toLowerCase
164Stringssimple printascii to characterfromCharCodechrchrchrchr$(char) c(char) cfromCharCode
165Stringssimple printcharacter to asciicharCodeAtordords[0]asc(int) c(int) ccharCodeAt
166Stringssimple printaccessing n-th charactercharAts[n]s[n]s[n]at(91)charAtcharAtaref
167Stringssimple printextract a substringmid$substrs[n:m+1]s[n,len]substringsubstrsubstringmid$
168Stringssimple printlocate a substringindexOfstrposindexstring firstfindindexOfindexOf
169Stringssimple printlocate a substring (starting at the end)strrposrindexstring lastrfindlastIndexOflastIndexOf
170Booleans#Booleanstype namebooleanboollogic!boolbooleanboolean
171Booleans#Booleansfalse valueexit status different from 0''()array(){}niloff'\0'falsenil
172Booleans#Booleanstrue valueexit status 0ontrueanything not falsetrueanything not falseanything not falseonanything not falsetruetrueanything not false
173Booleans#Booleanslogical notnot(94)!not(94)!not(94)not(94)not(94)!!!not(94)not(94)
174Booleanslogical or / andshort circuit| / &|| / &&or / andor / andor / andor / and|| / &&|| / &&|| / &&|| / &&or / and
175Booleanslogical or / andnon short circuit (always evaluates both arguments)?| /| / &| / &
176Bags and Lists#Bags and Liststype nameListarraylistlistvectorList
177Bags and Lists#Bags and Listslist concatenationconcat,++appendSeq
178Bags and Listslist flatteningone level depthflattenFlatten{*}$l
179Bags and Listslist flatteningrecursive
180Bags and Listslist flatteninglist constructorArray(a, b, c)(100)( a, b, c )array(a, b, c)[ a, b, c ](97)  - a\n  - b\n  - c{ a, b, c }(98)list(a, b, c)
181Bags and Listslist flatteninglist/array indexinga[i]a[i]a[i]a[i]a[i]slicenode[i]at(102)a[i]a[i]aref
182Bags and Listsadding an element at the beginning (list cons)return the new list (no side-effect)|[e l]
183Bags and Listsadding an element at the beginning (list cons)side-effectunshiftarray_unshift
184Bags and Listsadding an element at indexreturn the new list (no side-effect)linsert l i e
185Bags and Listsadding an element at indexside-effecta insertAt(e, i)a.insert(i, e)
186Bags and Listsadding an element at the endreturn the new list (no side-effect)arrayByAddingObjectlinsert l end e
187Bags and Listsadding an element at the endside-effectpusharray_pushappendpushlappendaddpush
188Bags and Listsadding an element at the endfirst elementfirstfirst
189Bags and Listsadding an element at the enditerator
190Bags and Listsadding an element at the endall but the first elementl[1:]lrange l 1 endtail
191Bags and Listsadding an element at the endlast elementlasta[-1]a[-1]node[last()]last
192Bags and Listsadding an element at the endall but the last element
193Bags and Listsadding an element at the endget the first element and remove itshiftshiftarray_shift
194Bags and Listsadding an element at the endget the last element and remove itpoppoparray_poppop
195Bags and Listsadding an element at the endfor each element do somethingfor v in l; do ...; donefor v in l ...for (var v in l) { ... }foreachfor v in l: ...for v in l ...For Each v in l ... Nextfor_eachl foreach(v, ...)
196Bags and Listsadding an element at the endtransform a list (or bag) in another onemapmapcollect
197Bags and Listsadding an element at the endtransform two lists in parallelmap
198Bags and Listsadding an element at the endfind an elementindexOffirst(22)detectlsearch -exact
199Bags and Listskeep elementsmatchingselectInPlacegrepgrepselect
200Bags and Listskeep elementsnon matching
201Bags and Listskeep elementspartition a list: elements matching, elements non matchingPartition
202Bags and Listssplit a listin 2 based on a predicate
203Bags and Listssplit a listinto sublists delimited by elements matching a predicate
204Bags and Listssplit a listinto a list of lists of same value
205Bags and Listssplit a listinto sublists based on a predicate
206Bags and Listssplit a listis an element in the listinMemberinclude?
207Bags and Listssplit a listis the predicate true for an elementdetectSomeany?
208Bags and Listssplit a listis the predicate true for every elementAllall?
209Bags and Listssplit a listsmallest / biggest elementmin / maxmin minstr / max maxstr(22)min / maxmin / maxmin / max
210Bags and Listssplit a listjoin a list of strings in a string using a glue stringl.join(s)implode(s, l)l * sjoin l sString.Join(s, l)join
211Bags and Listssplit a listlist sizelengthscalar @lcountlenlengthcountsizelengthlength
212Bags and Listssplit a listiterate with indexa foreach(i, e, ...)forAllIndeach_with_indexa foreach(i, e, ...)
213Bags and Listssplit a listremove duplicatesunique(106)uniqarray_uniqueuniq!lsort -unique
214Bags and Listssplit a listsortasortsort(107)sort(107)sort(107)sort_bysort(107)sort(107)sort(107)
215Bags and Listssplit a listreversereversereversearray_reversereversereverse_copyreverse
216Bags and Listssplit a listlist of couples from 2 listscombineziptranspose
217Bags and Listssplit a list2 lists from a list of couplessplittranspose
218Bags and Listssplit a listlookup an element in a association list
219Bags and Listssplit a listlist out of a bagto_listto_aarray gettoArray
220Bags and Listssplit a listf(... f(f(init, e1), e2) ..., en)reduce(109)reduce(109)reduce(109)inject
221Bags and Listssplit a listf(e1, f(e2, ... f(en, init) ...))reverseReduceFoldR
222Various Data Types#Various Data Typestuple typetyp1 * ... * typntuple!
223Various Data Types#Various Data Typestuple constructor( a, b, c )a, b, c
224Various Data Typescomputable tuple (these are a kind of immutable lists playing a special role in parameter passing)empty tuple()()[]
225Various Data Typescomputable tuple (these are a kind of immutable lists playing a special role in parameter passing)1-uple(a)a,a or [a]
226Various Data Typescomputable tuple (these are a kind of immutable lists playing a special role in parameter passing)using a tuple for a function callt*t
227Various Data Typesreference (pointer)creation:> :>>&newSTRef&
228Various Data Typesreference (pointer)dereference->(113)readSTRef->(113)
229Various Data Typesreference (pointer)assigning (when dereferencing doesn't give a lvalue)
230Various Data Typesoptional valuenull valuenullnil0(114)null
231Various Data Typesoptional valuevaluev*v(114)v
232Various Data Typesoptional valuetype name
233Various Data Typesoptional valuenull coalescing||??
234Various Data Typesrecordtype declarationdata Typ = N0 { n1, n2 :: typ1, n3 :: typ3, ... }
235Various Data Typesrecordselectorr[field]...->.r[field]
236Various Data Typesrecordunion type declaration
237Various Data Typesrecordenumerated type declarationenum typ { n1; n2; ... }(118)enum typ { n1; n2; ... }(118)
238Various Data Typesdictionarytype nameHashTablearraydictHashHashTableHashTable
239Various Data Typesdictionaryconstructorarray( a => b, c => d )Hash[ a, b, c, d ]new t { {a, b}, {c, d} }fromList
240Various Data Typesdictionaryaccess: read/writeh[k]h[k]h[k]h[k]h[k]h[k]h[k]
241Various Data Typesdictionaryaccess: readgetfetchget
242Various Data Typesdictionaryaccess: writeputput
243Various Data Typesdictionaryhas the key ?ink in hisset(h[k]), array_key_exists(k, h)k not in hhas_key?, include?, key?, member?find(120)containsKeyk in h
244Various Data Typesdictionaryremove by keydeleteunset(h[k])deleteeraseremovedelete
245Various Data Typesdictionarylist of keyskeySetarray_keyskeysAllKeyskeySet
246Various Data Typesdictionarylist of valuesvaluesarray_valuesvaluesvalues
247Various Data Typesdictionarymergeupdate(121)putAll(121)
248Various Data Typesrangeinclusive .. inclusive[ a .. b ]Range witha .. bRange with
249Various Data Typesrangeinclusive .. exclusivea ... b