GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing rigaux.org — syntax across languages (One Big Page)

Introduction

What's this about?

  • Language Designers:

    Looking for operator or function names? Well have a look at the following and remember using existing one may ease the transition :)

  • Language Users:

    You know one language and want to find the corresponding operator or function in another language

  • Language lovers:

    Want to know the various ways people invented for commenting/assigning/...?

This is of course incomplete. I welcome contributions!

You may also have a look at this information sorted by languages.

Light Version

Same content split into multiple html files

Categories

  • Various
    • commenting
    • documentation comment
    • information about the current line and file
    • tokens
    • breaking lines (useful when end-of-line and/or indentation has a special meaning)
    • variable assignment or declaration
    • grouping expressions
    • block (grouping statements, especially when statements are not expressions)
    • use a block as a return value (when statements are not expressions)
    • equality / inequality
    • comparison
    • runtime evaluation
    • manual memory allocation
    • force garbage collection
  • Functions
    • function call
    • partial application (in the examples below, a normal call is "f(a,b)")
    • function definition
    • anonymous function
    • function return value
    • function called when a function is not defined (in dynamic languages)
    • runtime inspecting the caller information
    • function composition
    • identity function
  • Control Flow
    • sequence
    • if_then
    • if_then_else
    • ifnot_then (unless)
    • multiple selection (switch)
    • loop
    • breaking control flow
    • exception
    • call-with-current-continuation
  • Types
    • declaration
    • annotation (or variable declaration)
    • cast
    • mutability, constness
  • Object Oriented & Reflexivity
    • method invocation
    • object creation
    • object cloning
    • manually call an object's destructor
    • class declaration
    • testing class membership
    • get the type/class corresponding to an object/instance/value
    • methods available
    • inheritance
    • has the method
    • current instance
    • accessing parent method
    • accessing child method
  • Package, Module
    • package scope
    • declare
    • import
  • Strings
    • type name
    • character type name
    • character "z"
    • strings
    • multi-line
    • convert something to a string (see also string interpolation)
    • serialize (marshalling)
    • unserialize (un-marshalling)
    • sprintf-like
    • simple print
    • string equality & inequality
    • string size
    • string concatenation
    • duplicate n times
    • upper / lower case character
    • uppercase / lowercase / capitalized string
    • ascii to character
    • character to ascii
    • accessing n-th character
    • extract a substring
    • locate a substring
    • locate a substring (starting at the end)
  • Booleans
    • type name
    • false value
    • true value
    • logical not
    • logical or / and
  • Bags and Lists
    • type name
    • list concatenation
    • list flattening
    • list constructor
    • list/array indexing
    • 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
    • all but the last element
    • get the first element and remove it
    • get the last element and remove it
    • for each element do something
    • transform a list (or bag) in another one
    • transform two lists in parallel
    • find an element
    • keep elements
    • partition a list: elements matching, elements non matching
    • split a list
    • is an element in the list
    • is the predicate true for an element
    • is the predicate true for every element
    • smallest / biggest element
    • join a list of strings in a string using a glue string
    • list size
    • iterate with index
    • remove duplicates
    • sort
    • reverse
    • list of couples from 2 lists
    • 2 lists from a list of couples
    • lookup an element in a association list
    • list out of a bag
    • f(... f(f(init, e1), e2) ..., en)
    • f(e1, f(e2, ... f(en, init) ...))
  • Various Data Types
    • tuple type
    • tuple constructor
    • computable tuple (these are a kind of immutable lists playing a special role in parameter passing)
    • reference (pointer)
    • optional value
    • record
    • union type declaration
    • enumerated type declaration
    • dictionary
    • range
  • Mathematics
    • type name
    • numbers syntax
    • addition / subtraction / multiplication / division
    • exponentiation (power)
    • negation
    • random
    • operator priorities and associativities
    • square root / e-exponential / absolute value
    • trigonometry
    • logarithm
    • euclidean division (both quotient and modulo)
    • modulo
    • truncate / round / floor / ceil
    • bitwise operators
  • Threads
    • thread definition
    • thread creation
    • thread object creation
    • starting / stopping threads
    • passing data directly between threads
    • terminating thread communication due to a time-out
    • Thread Synchronization
    • Joining Another Thread
    • Thread Prioritization
    • Thread-safe sharing of data without synchronization

Various

  • commenting

    until end of line

    #Awk, BourneShell, CoffeeScript, E, FishShell, GNU-bc, GNU-sed, Icon, Io, Julia, Maple, merd, Perl, Perl6, PHP, Pliant, Python, Ruby, Tcl, YAML
    //BCPL, C#, C++, C99, Dylan, F#, Go, Io, Java, JavaScript, PHP, Pike, Scilab, YCP, Yorick
    --Ada, Cecil, Eiffel, Haskell, Lua, Sather, Simula, SQL92
    ;Assembler, Common Lisp, Emacs Lisp, Logo, MUMPS, Rebol, Scheme
    %Erlang, Matlab, Mercury, Oz, PostScript, Prolog, TeX
    remBasic
    'Visual Basic
    "Vimscript
    \Forth
    !Assembler, Fortran90
    NB.J
    C or * in column 1Fortran

    nestable

    (* ... *)Beta, F#, Mathematica, Modula-3, OCaml, Pascal, SML
    %( ... %)Matlab
    /* ... */Classic REXX, Dylan, Io, Oz, SQL99
    { ... }Pascal, Rebol
    {- ... -}Haskell
    #| ... |#(1)Common Lisp, Scheme
    #= ... =#Julia
    #[ ... ]Perl6
    #if 0 ... #endifC
    comment { ... }Rebol
    comment [ ... ]Rebol
    [ ... ](2)Rebol
    --[[ ... ]]Lua

    non nestable

    " ... "Smalltalk
    /* ... */B, C, C#, C++, CSS, GNU-bc, Go, Java, JavaScript, Mercury, PHP, Pike, PL/I, YCP, Yorick
    <!-- ... -->HTML, XML
    ( ... )Forth
    ###
    ...
    ###
    CoffeeScript

  • documentation comment

    until end of line

    ///C#, F#, Java
    -- |Haskell
    -- ^Haskell

    non nestable

    /** ... */(3)C, C#, E, Java, JavaScript, PHP
    (** ... *)F#

    {-| ... -}Haskell
    (** ... *)OCaml
    /* DOCUMENT ... */Yorick
    indexing identifier: "...";Eiffel
    someClass comment: '...'Smalltalk
    rebol [ Note: "..." ]Rebol
    func ["..." arg] ...Rebol
    class X:
    """...
    """
    
    def x():
    """...
    """
    
    (4)
    Python
    (define (f para1 para2) "..." ...)Scheme
    (defun f (para1 para2) "..." ...)Common Lisp, Emacs Lisp
    =pod
    ...
    =cut
    (5)
    Perl, Perl6
    =begin
    ...
    =end
    Ruby
    function MYFUNCTION
    %MYFUNCTION the very first comment line is displayed in the help table of contents
    %
    % the remaining lines are displayed when getting help for MYFUNCTION
    %
    
    Matlab

  • information about the current line and file

    __LINE__ __FILE__C, C++, Perl, PHP, Pike, Ruby
    __LINE__ __SOURCE_FILE__F#
    $?LINE $?FILEPerl6
    __file__Python
    (new System.Diagnostics.StackFrame(true)).GetFileLineNumber()
    (new System.Diagnostics.StackFrame(true)).GetFileName()
    C#
    Thread.currentThread().getStackTrace()[1].getLineNumber();
    Thread.currentThread().getStackTrace()[1].getFileName();
    Java
    system/script/header/file(6)Rebol
    SOURCELINE() / parse source OS . SOURCENAMEClassic REXX
    info frame 0Tcl8.5
    thisContext lineNumber / thisContext method sourceSmalltalk
    runtime.Caller(0)Go

  • tokens

    case-sensitivity (keywords, variable identifiers...)

    case-sensitiveAwk, B, BourneShell, C, C#, C++, CoffeeScript, F#, FishShell, Go, Haskell, Io, Java, JavaScript, Lua, Maple, Mathematica, Matlab, merd, Modula-3, OCaml, Perl, Perl6, Pike, Pliant, Prolog, Python, Ruby, Smalltalk, Tcl, XML, YAML, Yorick
    case-insensitiveAda, Assembler, Classic REXX, Common Lisp, CSS, Eiffel, Forth, HTML, Logo, Pascal, PL/I, Rebol, SGML, SQL92, Visual Basic
    case-sensitive: variables
    case-insensitive: keywords, functions, constants...
    PHP
    case-sensitive: identifiers
    case-insensitive: keywords
    E
    case-sensitive: identifiers
    case-insensitive: commands
    MUMPS
    case-sensitive: upper case disallowedGNU-bc

    what is the standard way for scrunching together multiple words

    camelCaseCoffeeScript, JavaScript
    CamelCase or camelCaseC#, E, Go, Haskell, Io, Java, JavaScript, Mathematica, Pascal, Smalltalk, Tcl, Visual Basic
    underscoresFishShell, GNU-bc, merd
    dotsLogo
    hyphensCommon Lisp, Emacs Lisp, Rebol, Scheme
    underscores for functions / types, unclear for modules / constructorsOCaml
    UPPER_CASEBourneShell
    lowercasenoseparatorMatlab
    underscores, UPPER_CASE for class namesEiffel
    CamelCase for classes, underscores for methodsPython
    CamelCase for types, underscores for functions, variables, ...Pliant
    CamelCase for methods, types and modules, underscore for functionsF#
    CamelCase for modules and classes, ALL_CAPS for constants, underscores for functions, variables, ...Ruby
    CamelCase for modules and classes, ALLCAPS for macros, underscores for methods, constants and variablesPike
    CamelCase for modules, ALL_CAPS for constants, unclear for functions / variablesPerl, Perl6
    CamelCase for variables, underscores for predicatesProlog
    usually lowercase or underscores, ALL_CAPS for macrosC
    usually underscoresC++
    Camel_CaseAda

    variable identifier regexp

    [a-zA-Z][a-zA-Z0-9]*FishShell, Mathematica, PL/I, Smalltalk
    [a-zA-Z][_a-zA-Z0-9]*Eiffel, Matlab, Vimscript
    [a-zA-Z](_?[a-zA-Z0-9])*Ada
    [_a-zA-Z][_a-zA-Z0-9]*Awk, B, C, C#, C++, E, Go, Maple, PHP, Python, Tcl
    [_a-zA-Z0-9]+BourneShell, Perl, Perl6
    [a-zA-Z0-9]+FishShell
    [_a-zA-Z][_a-zA-Z0-9]* or '[^']*'Pliant
    [_a-zA-Z$][_a-zA-Z0-9$]*Java
    [$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*CoffeeScript, JavaScript
    [a-zA-Z%][a-zA-Z0-9]*MUMPS
    [_a-z][_a-zA-Z0-9]*Ruby
    [_a-z][_a-zA-Z0-9]*[!?']*merd
    [_a-z][_a-zA-Z0-9']*Haskell, OCaml, SML
    [_a-zA-Z][_a-zA-Z0-9']*F#
    [_A-Z][_a-zA-Z0-9]*Mercury, Prolog
    [_a-zA-Z!0&*/:<=>?^][_a-zA-Z!0&*/:<=>?^0-9.+-]*Scheme
    [a-zA-Z!?@#][a-zA-Z0-9!?@#]*Classic REXX
    [_a-zA-Z?!.'+*&|=~-][_a-zA-Z0-9?!.'+*&|=~-]* or
    [^0-9[](){}":;/][^ \n\t[](){}":;/]*
    Rebol
    [a-z][a-z0-9_]*GNU-bc
    anything without a space and is not a numberCommon Lisp, Forth

    function identifier regexp (if different from variable identifier regexp)

    [_a-zA-Z][_a-zA-Z0-9]*[!?]?Ruby
    [_a-z][_a-zA-Z0-9]*Mercury, Prolog
    [A-Z][_a-zA-Z0-9]*(7)Vimscript
    [^ \t\n\r\f]+Tcl
    [^ \t\n\r\f/]+FishShell

    keyword regexp (if different from variable identifier regexp)

    [A-Z]+Modula-3

    type regexp (if different from variable identifier regexp)

    [_A-Z][_a-zA-Z0-9']*Haskell
    [_a-z][_a-zA-Z0-9']*Mercury, OCaml

    constant regexp (if different from variable identifier regexp)

    [A-Z][_a-zA-Z0-9]*Ruby
    [_A-Z][_a-zA-Z0-9']*Haskell, OCaml
    [_a-z][_a-zA-Z0-9']*Mercury

  • breaking lines (useful when end-of-line and/or indentation has a special meaning)

    nothing neededAda, B, C, C#, C++, Common Lisp, D, Eiffel, Emacs Lisp, F#, Forth, Go, Haskell, Java, JavaScript, Maple, Mathematica, OCaml, Oz, Pascal, Perl, Perl6, PHP, PostScript, Rebol, Scheme, Smalltalk, SML, XSLT, YCP
    \Awk, BourneShell, C, CoffeeScript, E, FishShell, GNU-bc, Io, Python, Ruby, Tcl
    _Visual Basic
    ,Classic REXX
    ~Logo
    ...Matlab

  • variable assignment or declaration

    assignment

    =Awk, B, Basic, BourneShell, C, C#, C++, Classic REXX, Erlang, Go, Icon, Io, Java, JavaScript, Lua, Mathematica, Matlab, Oz, Perl, Perl6, PHP, Pike, YCP, Yorick
    :=Ada, BCPL, Cecil, Dylan, E, Eiffel, Maple, Mathematica, Modula-3, Pascal, Pliant, Sather, Simula, Smalltalk, SML
    <-F#, OCaml
    _(8)Squeak
    :BCPL, Rebol
    ->(9)Beta
    defPostScript
    setqCommon Lisp, Emacs Lisp
    setfCommon Lisp
    setCommon Lisp, FishShell, Rebol
    SET v=...MUMPS
    set!Scheme
    isProlog
    make "v eLogo
    e v !Forth

    declaration

    =Haskell, Mercury, Prolog
    <-Haskell
    :-Prolog
    :=Io
    let v = e inF#, OCaml
    let val v = e inSML
    let v = e(10)BCPL, F#, Vimscript
    def v := e / var v := eE
    my / our / local / use varsPerl
    my / our / tempPerl6
    defineDylan, Scheme
    let let*Common Lisp, Scheme
    letrecScheme
    flet labels defun defmethod defvar defparameter defsetf ..Common Lisp
    local V1 = e V2 = e2 in ... endOz
    global v1, v2Python
    global v1 v2Matlab, Scilab
    :@Beta
    NEW vMUMPS
    v: tAda, Eiffel, Pascal
    t vC, C#, C++, Java
    var v tGo
    | v1 v2 |Smalltalk
    auto v1, v2; extrn v3, v4;B
    autoGNU-bc
    varJavaScript, Pliant
    gvarPliant
    variable v(11)Forth
    e value vForth
    Module[{x, y = v}, ... ]Mathematica
    Block[{x, y = v}, ... ]Mathematica
    With[{c1 = v1, c2 = v2, ... }, ...]Mathematica
    <xsl:variable name="v" select="e"/>XSLT

    both

    =CoffeeScript, GNU-bc, merd, Python, Ruby
    :=Go, merd
    set, variableTcl

  • grouping expressions

    ( ... )Ada, Awk, B, BCPL, Beta, C, C#, C++, Classic REXX, CoffeeScript, D, E, Eiffel, F#, GNU-bc, Go, Haskell, Io, Java, JavaScript, Julia, Logo, Lua, Maple, Mathematica, Matlab, merd, Modula-3, MSH, MUMPS, OCaml, Oz, Pascal, Perl, Perl6, PHP, Pike, Pliant, Prolog, Python, Rebol, Ruby, Scilab, Smalltalk, SML, SQL92, Tcl, Vimscript, XPath, YCP, Yorick
    [ ... ]Rebol
    indentationmerd
    $ ...Haskell
    begin ... endF#, FishShell, OCaml, Ruby
    space(12)merd

  • block (grouping statements, especially when statements are not expressions)

    { ... }Awk, BCPL, BourneShell, GNU-bc, GNU-sed, JavaScript, PHP, Pike, Tcl, Yorick
    { ... }(13)B, C, C#, C++, E, Go, Haskell, Java, Modula-3, Perl, Perl6, YCP
    ( ... )(13)BourneShell
    [ ... ](14)Logo, Smalltalk
    "..."Tcl
    begin ... end(13)Ada, Pascal
    (begin ...)Scheme
    BEGIN ... ENDModula-3
    do ... endClassic REXX
    do ... end(13)Lua, PL/I
    indentationCoffeeScript, F#, MUMPS, Pliant, Python
    indentation(13)Haskell, merd
    foo ... end where foo in { if, do, ... }Modula-2, Ruby
    foo ... end where foo in { if, for, while, ... }Matlab, Scilab
    foo ... end where foo in { if, loop, ... }Eiffel
    foo ... end foo where foo in { if, do, ... }Ada, Fortran90
    (* ... *)(15)BCPL
    (# ... #)Beta

  • use a block as a return value (when statements are not expressions)

    valofBCPL
    doPerl, Perl6
    proc() .. end procMaple

  • equality / inequality

    shallow

    == !=Awk, B, C, C++, CoffeeScript, F#, Go, Io, Java, OCaml, Perl, Perl6, Pike, Yorick
    = /=Eiffel, Fortran90
    = <>Forth, Logo, Maple, Modula-2, Pliant, Rebol
    = #(16)Modula-2, Modula-3
    = !=BourneShell, FishShell
    == === != !==(17)JavaScript, PHP
    === !==Perl6, PHP5
    == ~=Lua
    == ~~Smalltalk
    == ~==Dylan
    = '=MUMPS
    = ~= neqv(15)BCPL
    f= f<>Forth
    is_equal(18)Eiffel
    eq neEmacs Lisp, PostScript
    eq, eqlCommon Lisp
    eq? eqv?Scheme
    .EQ. .NE.Fortran
    is / is notPython
    is / isnotVimscript

    deep

    == !=Awk, C#, C++, E, merd, PHP5, Python, Ruby, Tcl, Vimscript, YCP
    == <>Python
    == /=Haskell
    == \=Oz
    == \==Classic REXX, Prolog
    = /=Ada
    = !=Maple, XPath
    = <>Beta, F#, OCaml, Pascal, Rebol, SML, SQL92, Visual Basic
    = ~=Dylan, Smalltalk
    == ~= eq ne isequal isequalwithequalnansMatlab
    == ~= eq ne isequalScilab
    =@= \=@= / = \= / =:= =\=(19)Prolog
    === =!= / == !=(20)Mathematica
    .eqLogo
    equal?Scheme
    equalsJava
    equalCommon Lisp, Emacs Lisp, Pike
    equalpCommon Lisp
    eqvPerl6
    deep_is_equalEiffel
    isEqualObjective-C

  • comparison

    < > <= >=Ada, Awk, Awk, B, Beta, C, C#, C++, Classic REXX, CoffeeScript, Common Lisp, Dylan, E, Eiffel, Emacs Lisp, F#, Forth, Go, Haskell, Io, Java, JavaScript, Logo, Lua, Maple, Mathematica, Matlab, merd, Modula-3, OCaml, Pascal, Perl, Perl6, PHP, Pike, Pliant, Python, Rebol, Ruby, Scheme, Scilab, Smalltalk, SML, SQL92, Tcl, Vimscript, Visual Basic, XPath, YCP, Yorick
    < > =< >=Mercury, Oz
    < > '> '<MUMPS
    << >> <<= >>=(21)Classic REXX
    @< / @=< / @> / @>=Prolog
    lt gt le gePerl, Perl6, PostScript
    -lt -gt -le -geBourneShell, FishShell, MSH
    .LT. .GT. .LE. .GE.Fortran
    u< u> u<= u>=Forth
    f< f>Forth

    returns 3 values (i.e. inferior, equal or superior)

    a <=> bmerd, Perl, Perl6, Ruby
    cmpPerl, Perl6, Python
    compareF#, Forth, Haskell, Mercury, OCaml, Pliant, Prolog, Smalltalk
    strcmpC, PHP
    three_way_comparisonEiffel
    string compareTcl
    compareToJava
    strings.Compare()Go

    returns 4 values (i.e. inferior, equal, superior or not comparable)

    comparePliant
    compareToE

    min / max (binary or more)

    min / maxBeta, C++, Common Lisp, Dylan, E, Eiffel, F#, Forth, Haskell, Io, Java, Lua, Maple, Matlab, merd, OCaml, PHP5, Pike, Pliant, Prolog, Python, Rebol, Scheme, Scilab, Smalltalk, SQL92, Tcl8.5, Yorick
    min minstr / max maxstr(22)Perl
    Min / MaxMathematica, Oz
    MIN / MAXClassic REXX, Modula-3
    measure-object -min / measure-object -maxMSH
    fmin / fmaxForth
    Integer'min / Integer'maxAda

  • runtime evaluation

    evalBourneShell, Common Lisp, Emacs Lisp, FishShell, JavaScript, Matlab, Perl, Perl6, PHP, Python, Ruby, Scheme, Tcl, YCP
    CoffeeScript.eval(23)CoffeeScript
    execPython
    evstr / execstrScilab
    dostringLua
    doStringIo
    evaluateForth
    Compiler evaluate:Smalltalk
    runtime_compile / compile + executePliant
    Compiler.evalExpression or Compiler.parseOzVirtualStringOz
    compile_stringPike
    interpretClassic REXX
    ToExpressionMathematica
    runLogo
    XECUTEMUMPS
    do / reduce / compose / loadRebol
    [...]Tcl
    =..(24)Prolog

  • manual memory allocation

    allocation

    mallocC
    allocate throwForth
    newAda

    deallocation

    freeC
    free throwForth

  • force garbage collection

    doGCBeta
    GC.startRuby
    gcLogo, Maple, Pike
    System.gc()Java
    System.gcDoOz
    System.GC.Collect()C#, F#
    gc.collect()Python
    gc_collect_cycles(25)PHP5
    full_collectEiffel
    garbage_collectMercury, Prolog
    collectgarbageLua
    Collector collectIo
    VM.garbageCollect()JavaScript
    Gc.full_major()OCaml
    Smalltalk garbageCollectSmalltalk
    System.Mem.performGCHaskell
    incremental garbage collection => not neededPerl, Perl6
    recycleRebol
    interp.gc()E
    (ext:gc)Common Lisp
    runtime.GC()Go


Functions

  • function call

    f(a,b,...)Ada, Awk, Awk, B, C, C#, C++, CoffeeScript, CSS, Dylan, E, Eiffel, Erlang, Go, Io, Java, JavaScript, Lua, Maple, Matlab, Mercury, merd, Modula-3, Pascal, Perl, Perl6, PHP, Pike, Prolog, Python, Ruby, XPath, YCP, Yorick
    f a b ...BourneShell, F#, FishShell, Haskell, Logo, Matlab, MSH, OCaml, Pliant, Rebol, SML, Tcl
    f(a,b,...f) or f[a,b,...] depending on the versionBCPL
    (f a b ...) (apply f l)Common Lisp, Emacs Lisp, Scheme
    (funcall f a b ...)Common Lisp, Emacs Lisp
    {f a b}Oz
    [apply f a b]Tcl8.5
    f[a,b,...]Mathematica
    f[a,b,...] or f.call(a,b,...)Ruby
    &$f(a,b,...) or $f->(a,b,...)Perl
    $f.(a,b,...)Perl6
    f a, b, ...CoffeeScript, Perl
    f, a, b, ...(26)Yorick
    v = f(a, b, ...) or call f a, b, ...Classic REXX
    a b ... fForth, PostScript
    (a,b,...)->&f or (a,b,...)->fBeta
    f:a(27)FL
    f@a(28)Mathematica
    a // f(28)Mathematica
    a ~ f ~ b(29)Mathematica
    .. [ f, A, B, ...]Prolog
    <xsl:call-template name="f">
        <xsl:with-param name="a" select=a/>
        <xsl:with-param name="b" select=b/>
    </xsl:call-template>
    XSLT

    with no parameter

    fAda, BourneShell, Eiffel, Forth, Haskell, Io, Logo, Matlab, Mercury, MSH, Pascal, Perl, Perl6, Pliant, PostScript, Prolog, Rebol, Ruby, Tcl, Yorick
    f()Awk, C, C#, C++, CoffeeScript, E, Erlang, F#, Go, Java, JavaScript, Lua, Maple, merd, OCaml, Perl, PHP, Pike, Python, SML, YCP
    (f)Common Lisp, Emacs Lisp, Scheme
    (funcall f)Common Lisp, Emacs Lisp
    {f}Oz
    f[]Mathematica
    f[] or f.callRuby
    &$f or $f->()Perl
    $f.()Perl6
    v = f()Classic REXX
    call fClassic REXX, Fortran
    f value(30)Smalltalk
    <xsl:call-template name="f">/XSLT

  • partial application (in the examples below, a normal call is "f(a,b)")

    give the first argument

    f aF#, Haskell, OCaml, SML
    f(a)Mercury
    f(a,)merd
    &f.assuming(var_name => a)Perl6
    functools.partial(f, a)(31)Python
    interp alias {} f_a {} f aTcl

    give the second argument

    f(,b)merd
    &f.assuming(b => b)Perl6
    flip f b(32)Haskell

    give the first argument to operator ">"

    (a >)Haskell, merd
    (>) aF#, OCaml

    give the second argument to operator ">"

    (> a)Haskell, merd

  • function definition

    sub f { ... }Perl, Perl6
    sub f($para1, $para2, ...) { ... }Perl6
    def f(para1, para2, ...): ...Python
    def f(para1, para2, ...) ... endRuby
    def f(para1, para2, ...) ... { ... }E
    f para1 para2 = ...Haskell
    let f para1 para2 = ...F#, OCaml
    f(para1, para2, ...) = valof $( ... $)BCPL
    f(para1, para2, ...) = ...merd
    f[para1_, para2_, ...] := ... para1 ...Mathematica
    f ... or f: para1 ...Smalltalk
    f: func [para1 para2 ...] ...Rebol
    /f { ... } defPostScript
    f := (para1, para2, ...) -> ...Maple
    f := method(para1, para2, ..., code)Io
    func f(a, b, c...) { ... }Yorick
    typ0 f(typ1 para1, typ2 para2, ...) { ... }C, C#, C++, Pike, YCP
    function f(para1, para2) { ... }Awk, JavaScript, PHP5
    function f(para1, para2) ... code ... endLua
    function f; ...; endFishShell
    function f { ... }KornShell
    function f { param(para1, [typ2]para2, ...) ... }MSH
    (define (f para1 para2) ...)Scheme
    (defun f (para1 para2) ...)Common Lisp, Emacs Lisp
    fun { F Para1 Para2 } ... endOz
    fun f para1 para2 = ...SML
    proc f {para1 para2} { ... }Tcl
    function retval = f(para1, para2)
    retval = ...
    Matlab, Scilab
    :- func f(typ1, typ2, ...) = typ0.
    f(Para1, Para2, ...) = ...
    Mercury
    function f(para1 : type1; para2 : typ2; ...) return retval is
    begin
       ...
    end f;
    Ada
    function f para1 para2 -> retval
      arg typ1 para1; arg typ2 para2; arg rettyp retval;
      ...
    Pliant
    function f(para1 : typ1, para2 : typ2, ...) : retval;
    var retval : typ0;
    begin
      ...
    end
    Pascal
    f (para1 : typ1; para2, para3 : typ2; ...) : rettyp is
    do
      ...
    end
    Eiffel
    <xsl:template name="f">
        <xsl:param name="para1"/>
        <xsl:param name="para2"/>
    
        ...
    </xsl:template>
    XSLT
    Function f(para1, para2) ... End FunctionVisual Basic
    : f ... ;Forth
    f() { ... }BourneShell, KornShell
    f : procedure
      ...
    return retval
    Classic REXX
    to f :para1 :para2
       ...
    end
    Logo
    func f(para1 typ1, para2 typ2, ...) (typ3, ...) { ... }Go

    procedures

    procedure f(para1 : typ1; para2, para3 : typ2);
    begin
      ...
    end
    Pascal
    f (para1 : typ1; para2, para3 : typ2; ...) is
    do
      ...
    end
    Eiffel
    procedure f(para1 : typ1; para2 : MODE type2; ...) is
    begin
       ...
    end f;
    
    MODE ::= | OUT | IN OUT
    Ada
    void f(typ1 para1, typ2 para2, ...) { ... }C, C#, C++, Pike
    let f(para1, para2, ...) be $( ... $)BCPL
    proc { F Para1 Para2 } ... endOz
    f := proc(para1, para2, ...) ... end procMaple
    Sub f(para1, para2) ... End SubVisual Basic
    function f(para1, para2)
    ...
    Matlab, Scilab
    f : procedure
      ...
    return
    Classic REXX
    func f(para1 typ1, para2 typ2, ...) { ... }Go

    variable number of arguments

    one can use overloading on different number of argumentsC++, Java
    sub f { ... @_ }Perl
    sub f; ... $argv; endFishShell
    f() { ... $@ }BourneShell
    f := ... ## &Mathematica
    f[params___] := ... params ...Mathematica
    function f(varargin)
    for i=1:nargin
     ...(varargin{i})
    end
    Matlab
    function f(varargin)
    for e=varargin
     ...(e)
    end
    Scilab
    (args...) -> ...CoffeeScript
    (lambda x ...) or(33)Scheme
    f(args ...typ0)(34)Go

    predicates

    f(Para1, Para2, ....) :- ... .Prolog

  • anonymous function

    sub { my ($a, $b) = @_; ... }Perl
    { my ($a, $b) = @_; ... }(35)Perl
    { ... } (arguments are in the stackPostScript
    [ ... ]Logo
    { param(para1, [typ2]para2, ...) ... }MSH
    {|a, b| ... }(36)Ruby
    [:a :b| ... ]Smalltalk
    [list {a b} {...}]Tcl8.5
    lambda a, b: ...Python
    lambda(typ1 para1, typ2, para2, ...) { ... };Pike
    (a, b) => ...C#3, CoffeeScript
    (a, b) -> ...CoffeeScript, Maple
    a, b -> ...merd
    -> $a, $b { ... }Perl6
    \a b -> ...Haskell
    :noname ...Forth
    fn (a, b) => ...SML
    fun a b -> ...F#, OCaml
    (func(A, B) = C :- ...)Mercury
    function(a, b) { ... }JavaScript, PHP5
    function(a, b) use (&$v1, $v2) { ... }(37)PHP5
    function(a, b) ... endLua
    Function[{a, b}, ....](38)Mathematica
    fun(a, b) -> ... endErlang
    fun {$ A B} ... end(39)Oz
    func [a b ...] ...Rebol
    def _(para1, para2, ...) ... { ... }E
    proc {|a, b| ...}Ruby
    lambda {|a, b| ...}Ruby
    (lambda (a b) ...)Common Lisp, Emacs Lisp, Scheme
    inline('...x...y...')(40)Matlab
    method(a, b, ...)Io
    method(a, b) ... end method(41)Dylan
    create_function(',','...')PHP
    delegate(ta a, tb b) { ... }C#2
    [](ta a, tb b) { ... }C++-0x
    [](ta a, tb b) -> typ { ... }C++-0x
    func(para1 typ1, ...) (typ2, ...) { ... }Go

  • function return value

    breaks the control flow

    return(42)Ada, Awk, B, BCPL, BourneShell, C, C#, C++, Classic REXX, CoffeeScript, Common Lisp, E, FishShell, Go, Io, Java, JavaScript, Lua, Maple, Matlab, Perl, Perl6, PHP, Pike, Pliant, Python, Rebol, Ruby, Tcl, Vimscript, YCP, Yorick
    ReturnMathematica, Visual Basic
    RETURNModula-3
    resultis(43)BCPL
    return-from xxxCommon Lisp
    ^Smalltalk
    Exit Function / Exit SubVisual Basic
    exitForth
    outputLogo

    function body is the result

    no syntax needed(44)CoffeeScript, Common Lisp, Dylan, Emacs Lisp, Erlang, F#, Haskell, Io, Maple, Mathematica, Matlab, OCaml, Oz, Perl, Perl6, Rebol, Ruby, Scheme, SML, Tcl

    setting the result

    Result := valEiffel
    <function name> = valVisual Basic
    <function name> := valPascal
    <retvar name> = val;Ada, Matlab

  • function called when a function is not defined (in dynamic languages)

    AUTOLOADPerl
    AUTOSCALAR, AUTOMETH, AUTOLOAD...Perl6
    __autoloadPHP5
    __getattr__Python
    method_missingRuby
    doesNotUnderstandSmalltalk
    __noSuchMethod__(45)CoffeeScript, JavaScript
    unknownTcl
    no-applicable-methodCommon Lisp
    doesNotRecognizeSelectorObjective-C
    TryInvokeMember(46)C#
    match [name, args] { ... }E
    the predicate failProlog
    forwardIo

  • runtime inspecting the caller information

    callerPerl, Perl6, Ruby
    callIo
    inspect.stack()[1]Python
    backtracePike
    debug_backtracePHP5
    trace 'I'Classic REXX
    evalin('caller', ...)Matlab
    current_predicateProlog
    thisContext senderSmalltalk
    where(2)Maple
    info levelTcl
    runtime.Caller(0)Go

  • function composition

    .Haskell
    ~merd
    oSML
    @Maple
    composeDylan
    CompositionMathematica
    <<F#
    >>F#

  • identity function

    idHaskell
    identityCommon Lisp
    IdentityMathematica
    yourselfSmalltalk


Control Flow

  • sequence

    ,C, C++, Go, JavaScript, Matlab, Perl, Pike, Prolog, Scilab
    .Smalltalk
    ;Ada, Awk, B, Beta, BourneShell, C, C#, C++, E, F#, FishShell, GNU-sed, Go, Haskell, Io, Java, JavaScript, Maple, Mathematica, Matlab, merd, Modula-3, OCaml, Pascal, Perl, Perl6, PHP, Pike, PL/I, Pliant, Python, Ruby, SML, Tcl, YCP
    :Maple
    nothing, optionally ;Classic REXX, Lua
    spaceEiffel, Rebol
    end-of-lineAssembler, Awk, Basic, BourneShell, CoffeeScript, E, F#, FishShell, Fortran, GNU-sed, Haskell, Io, JavaScript, Lua, Matlab, merd, Pliant, Python, Ruby, Tcl
    (begin ...)Scheme
    (progn ...) (prog1 ...) (prog2 ...)Common Lisp, Emacs Lisp
    >>Haskell

  • if_then

    if c then ...CoffeeScript, F#, merd, OCaml, Pascal, Tcl
    if c then ... endEiffel, Lua, Oz, Ruby
    if c then ... end ifAda, Maple
    if c then ... fiMaple
    if c; then ... fiBourneShell
    if (c) then ... endDylan
    if c do ...BCPL
    IF c THEN ... ENDModula-2, Modula-3
    if (c) ...Awk, B, C, C#, C++, Java, JavaScript, PHP, Pike, YCP
    if c: ...Python
    if c ...Pliant, Rebol, Tcl
    if (c): ... endifPHP
    if c {...}Go, Perl6
    if c [...]Logo
    if (c) {...}E, Perl, Yorick
    IF c ...MUMPS
    c -> ...FL
    c ... ifPostScript
    ... if cPerl, Ruby
    c if b1 thenForth
    (if c ...)Common Lisp, Scheme
    (when c ...)Emacs Lisp
    c and ...Perl, Ruby
    if(c, ...)Io
    If[c, ...]Mathematica
    if(c) then(...)Io
    c ifTrue(...)Io
    c ifTrue: ...Smalltalk
    <xsl:if test="c">...</xsl:if>XSLT
    if c ... endifVimscript
    If c Then ...Visual Basic
    If c
      ...
    End If
    Visual Basic
    if c; ... endRuby
    if c; ...; endFishShell
    if c, ..., endMatlab
    if c
      ...
    end
    Matlab, Ruby
    if c then ; ...
    
    if c then
      ...
    
    if c then do
      ...
    end
    Classic REXX
    c and ...Perl
    t labelGNU-sed
    if c
        ...
    CoffeeScript

  • if_then_else

    if c then b1 else b2CoffeeScript, F#, Haskell, merd, OCaml, SML
    if c then b1 else b2 endEiffel, Lua, Ruby
    if c then b1 elsif c2 then b2 else b3 end ifAda
    if c then b1 elseif c2 then b2 else b3 endEiffel, Oz
    if (c) then b1 elseif (c2) then b2 else b3 endDylan
    IF c THEN b1 ELSIF c2 THEN b2 ELSE b3 ENDModula-3
    If c Then b1 ElseIf c2 Then b2 Else b3 End IfModula-2
    if (c) b1 else b2Awk, B, C, C#, C++, Java, JavaScript, Pike, YCP
    if c b1 elsif c2 b2 b3Tcl
    if c then b1 elseif c2 then b2 else b3Tcl
    if c then begin b1 end else begin b2 endPascal
    if c b1 eif c2 b2 else b3Pliant
    if c then b1 elif c2 then b2 else b3 end ifMaple
    if c; then b1; elif c2; then b2; else b3; fiBourneShell
    if c; b1; else b2; endFishShell
    if c1, b1, elseif c2, b2, else, b3, endMatlab
    if (c) b1 elseif (c2) b2 else b3PHP
    if (c): b1 elseif (c2): b2 else: b3 endifPHP
    if (c) {b1} elsif (c2) {b2} else {b3}Perl
    if (c) {b1} else {b2}E, Yorick
    (if c b1 b2)Common Lisp, Scheme
    (if c then b1 else b2)Mercury
    (c -> b1 ; c2 -> b2 ; b3)Mercury
    c -> b1 ; b2FL
    if(c, b1, b2)Io
    If[c, b1, b2]Mathematica
    if(c) then(b1) else(b2)Io
    c ifTrue: b1 ifFalse: b2Smalltalk
    ifelse c [b1] [b2]Logo
    shunt c b1 c2 b2 b3Pliant
    either c b1 b2 / if/else c b1 b2Rebol
    (cond (c b1) (c2 b2) (t b3))Common Lisp, Emacs Lisp
    (cond (c b1) (c2 b2) (else b3))Scheme
    Which[c, b1, c2, b2, True, b3]Mathematica
    c -> b1 ; c2 -> b2 ; b3Prolog
    case when c; b1 when c2; b2 else b3 endRuby
    test c then b1 or b2BCPL
    e | c = b1 | c2 = b2 | otherwise = b3(47)Haskell
    c b1 b2 ifelsePostScript
    c if b1 else b2 thenForth
    c ? b1 : b2Awk, B, C, C#, C++, Java, JavaScript, Perl, PHP, Ruby, Tcl, YCP, Yorick
    c ?? b1 !! b2Perl6
    b1 if c else b2(31)Python
    $SELECT(c:b1,c2:b2,1:b3)MUMPS
    c -> b1, b2BCPL
    (if c then b1 else b2 fi)Beta
    <xsl:choose>
        <xsl:when test="c"> b1 </xsl:when>
        <xsl:when test="c2"> b2 </xsl:when>
        <xsl:otherwise> b3 </xsl:otherwise>
    </xsl:choose>
    XSLT
    if c1 ... elseif c2 ... else ... endifVimscript
    If c Then b1 Else b2Visual Basic
    If c
      b1
    Else
      b2
    End If
    Visual Basic
    if c: 
      b1 
    elif c2:
      b2 
    else: 
      b3
    Python
    if c
      b1
    elsif c2
      b2
    else
      b3
    end
    Ruby
    if c
      b1
    elseif c2
      b2
    else
      b3
    end
    Matlab
    if c then ; b1 ; else ; b2
    
    if c then
      b1
    else
      b2
    
    if c then do
      b1
      ...
    end
    else do
      b2
      ...
    end
    Classic REXX
    IF c ...
    ELSE ...
    MUMPS
    if c
      b1
    else if c2
      b2
    else
      b3
    CoffeeScript
    if c {b1} else if c2 {b2} else {b3}Go

  • ifnot_then (unless)

    unlessCoffeeScript, Emacs Lisp, Perl
    ifFalseSmalltalk
    if(c) not then(...)Io

  • multiple selection (switch)

    switch (val) { 
       case v1: ...; break; 
       case v2: case v3: ...; break; 
       default: ...;
     }
    C, C++, Java, JavaScript, PHP, Pike
    switch val { 
       case v1: ...; goto done;
       case v2: case v3: ...; goto done; 
     }
     ...;
     done:
     
    B
    switch (val) { 
       case v1: ...; break; 
       case v2: case v3: ...; break; 
       default: ...; break;
     }
    (48)
    C#
    switch (val) { 
       match v1 { ... } 
       match v2 { ... } 
       match _ { ... }
    }
    E
    switchon val  
       case v1: ...
       case v2: ...
       default: ...
    BCPL
    switch val
      case v1
        ...
      case v2 v3
        ...
      case '*'
        ...
    end
    FishShell
    switch val
      case v1
        ...
      case {v2,v3}
        ...
      otherwise
        ...
    end
    Matlab
    case val of
       v1 : ...; 
       v2, v3 : ...
       else ...
     end
    Pascal
    switch val {
        v1 {...} 
        v2 - v3 {...}
        default {...}
    }
    Tcl
    case val in
       v1) statement1 ;;
       v2|v3) statement23 ;;
       *) statement_else ;;
    esac
    BourneShell
    (if val
        // v1 then ...
        // v2 then ... 
        else ...
        if)
    Beta
    match val with
     | v1 -> ...
     | v2 | v3 -> ...
     | _ -> ...
    F#, OCaml
    case val of
       v1 => ...
     | v2 => ...
     | _ => ...
    SML
    CASE val OF
       v1 => ...
     | v2 => ...
     ELSE => ... END
    Modula-3
    case val of
       v1 -> ...
       v2 -> ...
       _ -> ...
    Haskell
    val case
       v1 of ... endof
       v2 of ... endof
       ...
    endcase
    Forth
    val.
       v1 -> ...
       v2 -> ...
       _ -> ...
    merd
    (case val
       ((v1) ...)
       ((v2) ...)
       (otherwise ...))
    Common Lisp
    (case val
       ((v1) ...)
       ((v2) ...)
       (else ...))
    Scheme
    case val is
       when v1 => ...
       when v2 | v3 => ...
       when others => ...
     end case;
    Ada
    case val
       when v1; ...
       when v2, v3; ...
       else ...
     end
    Ruby
    inspect val
       when v1 then statement1
       when v2, v3 => statement23
       else statement_else
     end
    Eiffel
    select (val);
       when (v1) statement1;
       when (v2, v3) statement23;
       otherwise statement_else;
     end;
    PL/I
    X = val,
    (X = v1, ... ; X = v2, ... ; ...)
    Mercury, Prolog
    my %case = (
        v1 => sub { ... },
        v2 => sub { ... },
    ); 
    if ($case{val}) { $case{val}->() } else { ... }
    Perl
    use Switch;
    switch ($val) {
        case v1 { ... }
        case v2 { ... }
        else ...
    })
    (49)
    Perl
    given $val {
        when v1 { ... }
        when v2 { ... }
        default { ... }
    }
    Perl6
    Select val
        Case v1
    	...
        Case v2, v3
    	...
        Case Else
    	...
    End Select
    Visual Basic
    switch (val) {
        v1 { ... }
        v2 { ... }
        default { ... }
      }
    MSH
    switch val [
        v1 [...]
        v2 [...]
    ]
    
    switch/default [
        v1 [...]
        v2 [...]
    ][...]
    Rebol
    val caseOf: {[v1]->[...]. [v2]->[...]} otherwise: ...Squeak
    Switch[val, v1, ..., v2, ..., _, ...]Mathematica
    select
      when v1 ...
      when v2 | v3 ...
      otherwise ...
    end
    Classic REXX
    CASE val
        WHEN v1 THEN ...
        WHEN v2 THEN ...
        ELSE ...
    END
    SQL92
    switch val {
        case v1, v2, ...:
            ...
            fallthrough
        case v3:
            ...
        default:
            ...
    }
    Go

  • loop

    forever loop

    loopCoffeeScript, merd, Perl6, PostScript, Ruby
    loop(...)Io
    loop ... end loopAda
    LOOP ... ENDModula-3
    (loop do ...)Common Lisp
    cycle (# do ... #)Beta
    repeatSqueak
    begin ... againForth
    foreverLogo, Rebol
    Do
        ...
    Loop
    Visual Basic
    do forever
      ...
    end
    Classic REXX
    for {}Go

    while condition do something

    while (c) ...Awk, B, C, C#, C++, E, Java, JavaScript, Perl, PHP, Pike, Ruby, YCP, Yorick
    while c ...CoffeeScript, Perl6, Tcl
    while c loop ... end loopAda
    while c do ...BCPL, Pascal, SML
    while c do ... doneF#, OCaml
    while c do ... end doMaple
    while c do ... endLua
    WHILE c DO ... ENDModula-3
    while c: ...Python
    while c; do ...; doneBourneShell
    while c; ...; endFishShell
    while c, ..., endMatlab
    while [c][...]Rebol
    while c [...]Logo
    while(c, ...)Io
    While[c, ...]Mathematica
    do.while [...] cLogo
    c whileTrue: ...Smalltalk
    (loop while c do ...)Common Lisp
    loop (# while ::< (# do c -> value #) do ... #)Beta
    begin c while ... repeatForth
    from until not c loop ... endEiffel
    while c
        ...
    Pliant
    while c do
        ...
    F#
    Do While c 
        ...
    Loop
    Visual Basic
    while c ... endwhileVimscript
    do while c
      ...
    end
    Classic REXX
    for c {...}Go

    do something until condition

    do ... until cPerl6
    do {...} until cPerl
    do ... while (!c)Awk, C, C#, C++, Java, JavaScript, Pike, Yorick
    begin ... end until cRuby
    begin ... c untilForth
    REPEAT ... UNTIL cModula-3
    loop (# until ::< (# do c -> value #) do ... #)Beta
    loop ... exit when c; end loopAda
    (loop do ... until c)Common Lisp
    ... repeatuntil cBCPL
    repeat ... until cLua, Pascal
    repeat ... until (c)YCP
    repeat, ..., cProlog
    until [... c]Rebol
    until c [...]Logo
    do.while [...] cLogo
    While[...; c]Mathematica
    [...] whileFalse: [c]Smalltalk
    Do 
    ...
    Loop Until c
    Visual Basic

    for each value in a numeric range, 1 increment (see also the entries about ranges)

    for (int i = 1; i <= 10; i++) ...C, C#, C++
    for (i = 1; i <= 10; i++) ...Awk, JavaScript
    for ($i = 1; $i <= 10; $i++) ...PHP
    foreach my $i (1 .. 10) { ... }Perl
    foreach ($i in 1..10) { ... }MSH
    for (1 .. 10) -> $i { ... }Perl6
    for i = 1:10, ..., endMatlab
    for i = 1, 10 do ... endLua
    for i := 1 to 10 do ...Pascal
    for i = 1 to 10 do ... doneF#, OCaml
    For i = 1 To 10 ... NextVisual Basic
    for i in 1 .. 10 loop ... end loopAda
    for i in 1 .. 10 do ... doneF#
    for i in [1..10] ...CoffeeScript
    for i in xrange(1, 11)Python
    for i in (seq 10); ...; endFishShell
    FOR I=1:1:10 ...MUMPS
    for i from 1 to 10 do ... end doMaple
    for [i 1 10 +1] [...]Logo
    for {set i 1} {$i <= 10} {incr i} {...}Tcl
    1 1 10 ... forPostScript
    11 1 do ... loopForth
    (1..10).each {|i| ... }Ruby
    1.upto(10) {|i| ... }Ruby
    1 to(10) foreach(...)Io
    1 to: 10 do: [...]Smalltalk
    (loop for i from 1 to 10 do ...)Common Lisp
    do label i = 1, 10Fortran
    Do[..., {i, 1, 10}](50)Mathematica
    do i = 1 for 10
      ...
    end
    Classic REXX
    for i := 1; i <= 10; i++ {...}Go

    for each value in a numeric range, 1 decrement

    for X := 10 downto 1 do ...Pascal
    for i = 10 downto 1 do ... doneF#, OCaml
    for i in reverse 1 .. 10 loop ... end loopAda
    for i in 10 .. -1 .. 1 do ... doneF#
    for (int i = 10; i >= 1; i--) ...C, C#, C++
    for (my $i = 10; $i >= 1; $i--) { ... }Perl
    loop (my $i = 10; $i >= 1; $i--) { ... }Perl6
    for (i = 10; i >= 1; i--) ...Awk, JavaScript
    for ($i = 10; $i >= 1; $i--) ...PHP
    from i := 10 until i < 1 loop ... i := i - 1 endEiffel
    for i = 10:-1:1, ..., endMatlab
    for i = 10, 1, -1 do ... endLua
    For i = 10 To 1 Step -1 ... NextVisual Basic
    for i in xrange(10, 0, -1)Python
    for i in `seq 10 -1 1`; do ...; doneBourneShell
    for i in (seq 10 -1 1); ...; endFishShell
    for i from 10 to 1 by -1 do ... end doMaple
    for [i 1 10 -1] [...]Logo
    FOR I=10:-1:1 ...MUMPS
    for {set i 10} {$i >= 1} {incr i -1} {...}Tcl
    10 -1 1 ... forPostScript
    1 10 do ... -1 +loopForth
    1 to: 10 by: -1 do: [...]Smalltalk
    10 to(1) foreach(...)Io
    10.downto(1) {|i| ... }Ruby
    (loop for i from 1 to 10 by -1 do ...)Common Lisp
    do label i = 10, 1, -1Fortran
    Do[..., {i, 10, 1, -1}]Mathematica
    do i = 10 to 1 by -1
      ...
    end
    Classic REXX
    for i in [10..1] ...CoffeeScript
    for i := 10; i >= 1; i-- {...}Go

    for each value in a numeric range, free increment

    for (int i = 1; i <= 10; i += 2) ...C, C#, C++, Pike
    for (i = 1; i <= 10; i += 2) ...Awk, JavaScript
    for ($i = 1; $i <= 10; $i += 2) ...PHP
    for (my $i = 1; $i <= 10; $i += 2) { ... }Perl
    loop (my $i = 1; $i <= 10; $i += 2) { ... }Perl6
    from i := 1 until i > 10 loop ... i := i + 2 endEiffel
    for i = 1:3:10, ..., endMatlab
    for i = 1, 10, 2 do ... endLua
    For i = 1 To 10 Step 2 ... NextVisual Basic
    for i in 1 .. 2 .. 10 do ... doneF#
    for i in xrange(1, 11, 2)Python
    for i in (seq 1 2 10); ...; endFishShell
    for i from 1 to 10 by 2 do ... end doMaple
    for [i 1 10 2] [...]Logo
    FOR I=1:2:10 ...MUMPS
    for {set i 0} {$i <= 10} {incr i 2} {...}Tcl
    1 2 10 ... forPostScript
    11 1 do ... 2 +loopForth
    1 to: 10 by: 2 do: [...]Smalltalk
    (1..10).step(2) {|i| ... }Ruby
    1 to (9,2) foreach(...)Io
    (loop for i from 1 to 10 by 2 do ...)Common Lisp
    do label i = 1, 10, 2Fortran
    Do[..., {i, 1, 10, 2}]Mathematica
    do i = 1 to 10 by 2
      ...
    end
    Classic REXX
    for i in [1..10] by 2 ...CoffeeScript
    for i := 1; i <= 10; i += 2 {...}Go

    for "a la C" (while + initialisation)

    forAwk, C, C#, C++, Go, Java, JavaScript, Mathematica, MSH, Perl, PHP, Pike, Tcl, Yorick
    loopPerl6
    for ((x = 0; x < 10; x++)); do ...; doneBourneShell
    from init_code until c loop ... incr_statement endEiffel
    (loop with VAR = INITIAL-VALUE ... while CONDITION finally INCREMENT ...)Common Lisp

  • breaking control flow

    returning a value

    return(42)Ada, Awk, B, BCPL, BourneShell, C, C#, C++, Classic REXX, CoffeeScript, Common Lisp, E, FishShell, Go, Io, Java, JavaScript, Lua, Maple, Matlab, Perl, Perl6, PHP, Pike, Pliant, Python, Rebol, Ruby, Tcl, Vimscript, YCP, Yorick
    ReturnMathematica, Visual Basic
    RETURNModula-3
    resultis(43)BCPL
    return-from xxxCommon Lisp
    ^Smalltalk
    Exit Function / Exit SubVisual Basic
    exitForth
    outputLogo

    goto (unconditional jump)

    gotoAda, B, Basic, BCPL, C, C#, C++, Cobol, Fortran, Go, Logo, MUMPS, Pascal, Perl, PHP5, Yorick
    GotoMathematica
    go throwCommon Lisp
    signalClassic REXX
    bGNU-sed
    b, bra, jmpAssembler

    continue / break

    continue / breakAwk, C, C#, C++, CoffeeScript, E, FishShell, Go, Io, Java, JavaScript, Matlab, PHP, Pike, Python, Tcl, YCP, Yorick
    Continue / BreakMathematica
    next / lastPerl, Perl6
    next / break(51)Maple, Ruby
    / breakBCPL, Lua
    / break/returnRebol
    / exitAda, PostScript
    / stopLogo
    restart / leaveBeta, Pliant
    / Exit Do, Exit ForVisual Basic
    / return-from xxx or returnCommon Lisp
    iterate / leaveClassic REXX
    / leaveForth

    redo / retry

    redo/Perl, Perl6
    redo / retryIo, Ruby

  • exception

    throwing

    raiseAda, Eiffel, F#, merd, OCaml, Python, Ruby, Scheme-SRFI34, SML
    RAISEModula-3
    raise ... endOz
    Exception raiseIo
    throwC#, C++, CoffeeScript, E, Erlang, Forth, Haskell, Java, JavaScript, Logo, PHP5, Pike, Prolog, Rebol
    ThrowMathematica
    throw/nameRebol
    diePerl, Perl6
    return -codeTcl
    errorCommon Lisp, Dylan, Emacs Lisp, Lua, Lua, Maple, Matlab, Pliant, Yorick
    signalCommon Lisp, Dylan, Smalltalk
    signal predefined_condition_nameClassic REXX
    cerror warnCommon Lisp
    [NSException raise:name ...]Objective-C
    panic(v)Go

    catching

    try: a except exn: ...Python
    try a with exn -> ...F#, OCaml
    try a catch (exn) ...C#, C++, Java, JavaScript
    try a
      ...
    catch exn
      ...
    CoffeeScript
    try { ... } catch(t $v) { ... }PHP5
    try a catch exn then ... endOz
    try a catch exn: ... end tryMaple
    try(a) ; catch(...)Io
    try { a CATCH exn { ... } }Perl6
    TRY a EXCEPT exn => ... ENDModula-3
    a handle exn => ...SML
    a on: exception_name do: [:exn | ...]Smalltalk
    ifCurtailedSmalltalk
    rescueEiffel, Ruby
    eval {a}; if ($@) ...Perl
    exception when exception_name =>Ada
    catch a (\exn -> ...)Haskell
    catchErlang, Forth, Logo, Prolog, Rebol, Tcl
    CatchMathematica
    catch/nameRebol
    catch(...) or catch { ... };Pike
    if (catch(exn)) { ... } aYorick
    pcallLua
    with-exception-handler or guardScheme-SRFI34
    block a exception(exn) ... endDylan
    ?, shy, safePliant
    handler-bind handler-case ignore-errorsCommon Lisp
    NS_DURING a NS_HANDLER ... NS_ENDHANDLERObjective-C
    try
      a
    catch
      ...
    end
    Matlab
    signal on predefined_condition_name
    ...
    predefined_condition_name :
      ...
    
    Classic REXX
    recover()Go

    cleanup: code executed before leaving

    ensureRuby, Smalltalk
    finallyC#, F#, Java, Maple, Python
    FINALLYModula-3
    unwind-protectCommon Lisp, Emacs Lisp
    cleanupDylan
    dynamic-windScheme

    retrying: after catching an exception, tell the snippet to be re-run

    retryEiffel, Ruby, Smalltalk
    restartDylan

    resume execution where the exception took place

    resumeSmalltalk

  • call-with-current-continuation

    call-with-current-continuation(52)Scheme
    callccRuby, SML-NJ


Types

  • declaration

    typedef t nC, C++, Pike
    type n is tAda
    type n ...Pliant
    type n = tF#, Haskell, OCaml, Pascal, SML
    TYPE n = tModula-3
    using n = ...C#
    data n = tHaskell
    datatype n = tSML
    newtype n = tHaskell
    n = tmerd, Python
    n : tBeta
    (deftype n () 't)Common Lisp
    type n tGo

  • annotation (or variable declaration)

    :Ada, E, Eiffel, F#, Modula-3, OCaml, Pascal, SML
    ::Dylan, Haskell, Mercury
    !!merd
    t vC, C#, C++, Java, Perl6, Pike, Pliant, YCP
    (declare (t v))Common Lisp
    v :@ tBeta
    _t(53)Mathematica
    var n tGo

  • cast

    upcast

    (t) eC, C#, C++, Java, PHP
    t(e)Ada, Pascal
    [t] ePike
    static_cast<t>(e)C++
    e :> tOCaml
    e : tF#
    upcast eF#
    CAST(e as t)SQL92
    typecast(e,t)Matlab
    (t)(e)Go

    downcast (need runtime checking)

    (t) eJava
    t(e)Ada
    e : tE
    [t] ePike
    dynamic_cast<t>(e)C++
    e as tC#
    e :?> tF#
    downcast e(54)F#
    v ?= e(55)Eiffel
    NARROW(e, t)Modula-3
    typecast(e,t)Matlab

    computed conversion (calls an internal or a user-defined function)

    (t) eC++, Pike
    [t] eMSH
    t(e)C++, Matlab, Python
    t eF#
    e : tE
    e :: tHaskell
    cast e tPliant
    ... cast tPliant
    make t e / to t eRebol

  • mutability, constness

    type of a mutable value

    mutability is the defaultC, C#, C++, Go, Java, Matlab
    val x: TPascal
    T refF#, OCaml, SML
    STRef a THaskell
    in out T(56)Ada

    type of a constant value

    const TC++, C99
    constant TAda
    const x: TPascal
    constness is the defaultF#, Haskell, OCaml, SML
    const e tGo

    special cases

    "readonly" fields(57)C#
    "final" fields, parameters, local variables(57)Java


Object Oriented & Reflexivity

  • method invocation

    object.method(para)Ada, Beta, C#, C++, Cecil, CoffeeScript, Delphi-Kylix, E, Eiffel, F#, Icon, Java, JavaScript, merd, Modula-3, MSH, Perl6, Python, Ruby, Sather, Visual Basic
    object#method paraOCaml
    object:method(para)Lua
    object method(para)Io
    object method paraPliant, Tcl
    object method: para1 method_continuation: para2Smalltalk
    object <- method(para)(58)E
    [ object method: para ]Objective-C
    object->method(para)C++, Perl, PHP, Pike
    object["method"](para)Pike
    object/method paraRebol
    method object paraHaskell, Mercury
    (method object para)Common Lisp
    method(object, para)Ada, Dylan, Matlab
    para->methodBeta
    (send object method para)MzScheme

    with no parameter

    object.methodAda, Eiffel, F#, merd, Perl6, Ruby
    object.property(59)C#
    object.method()C#, C++, CoffeeScript, E, Java, JavaScript, Python
    object#methodOCaml
    object:methodPliant
    object->methodPerl
    object->method()PHP5, Pike
    object/methodRebol
    object["method"]()Pike
    object methodIo, Smalltalk
    [ object method ]Objective-C
    method objectHaskell, Mercury
    (method object)Common Lisp
    method(object)Ada, Dylan, Matlab
    (send object method)MzScheme

  • object creation

    newPHP, Pliant, Simula
    new class_name(...)C#, C++, CoffeeScript, F#, Java, JavaScript, Perl, PHP, Visual Basic
    new class_name ...CoffeeScript, OCaml
    class_name.new(...)Perl6, Ruby
    class_name newSmalltalk
    class_name(...)F#, Matlab, Pike, Python
    class_name v(...)C++
    v : class_nameAda
    class_name.CreateDelphi-Kylix
    !class_name!constructor_name(...)Eiffel
    &Beta
    make-objectMzScheme
    (make-instance class_name ...)Common Lisp
    [class_name alloc]Objective-C
    make class_name! ...Rebol
    def object_name { ... }E

  • object cloning

    o.clonePerl6
    o.clone(60)Eiffel, Ruby
    o.deep_cloneEiffel
    o.clone()Java
    o.Clone()C#
    clone $oPHP5
    o cloneIo
    clone / copy or deepCopySmalltalk
    Storable::dclonePerl
    [o copy]Objective-C
    copy.copy(o)(61)Python
    purecopyEmacs Lisp
    {< >} or Oo.copy oOCaml
    o2 = o(62)C++, Matlab, PHP
    $o2 = $oPHP
    o2.all := o.allAda
    make o []Rebol
    o_ : T'Class := o(63)Ada

  • manually call an object's destructor

    deleteC++, JavaScript
    destroyPike
    DESTROYPerl
    deallocObjective-C
    DisposeC#, F#
    del, __del__Python
    __destructPHP5
    Requires instantiation of Ada.Unchecked_DeallocationAda

  • class declaration

    classC#, C++, CoffeeScript, Haskell, Java, Matlab, MzScheme, OCaml, Perl6, PHP, Pike, Python, Ruby
    class c inherit p1 p2 ... feature decl decl ... endEiffel
    defclass defstructCommon Lisp
    subclassSmalltalk
    structC++
    typePliant
    type c is tagged record ... end record(64)Ada
    @interface c { ... } ... @endObjective-C
    :Beta
    type c() = class ... endF#
    type c() =
      ...
    F#

  • testing class membership

    isaMatlab, Perl
    is_a? kind_of?Ruby
    o.meta.isaPerl6
    isKindOf(65)Smalltalk
    isKindOfClassObjective-C
    dynamic_castC++
    instanceofCoffeeScript, Java, JavaScript, PHP5
    isinstancePython
    inAda
    isC#
    is_aPHP
    :?F#
    Program.inherits or Program.implementsPike
    entry_typePliant
    typepCommon Lisp
    ISTYPEModula-3
    object## < classname##Beta
    type.accepts(object) / object =~ v : typeE
    var ?= val(66)Eiffel

  • get the type/class corresponding to an object/instance/value

    classMatlab, Objective-C, Ruby, Smalltalk
    __class__Python
    getClassJava
    get_classPHP
    GetTypeF#
    typeidC++
    typeofC#, CoffeeScript, JavaScript
    type-ofCommon Lisp
    typeIo
    refPerl
    generatorEiffel
    metaPerl6
    object_programPike
    getAllegedTypeE

  • methods available

    methodsMatlab, Ruby
    get_class_methodsPHP
    getMethodsJava
    get-memberMSH
    indicesPike
    o.meta.getmethodsPerl6
    dirPython
    slotNamesIo
    o.GetType().GetMethods()F#
    o class selectors / o class allSelectorsSmalltalk
    o.__getAllegedType().getMessageTypes()E

  • inheritance

    child :< parentBeta
    class child : parentC#, C++
    class child < parent endRuby
    class child is parent { ... }Perl6
    class child extends parentCoffeeScript, Java, PHP5
    class child(parent):Python
    class child inherit parent endEiffel
    parent subclass: childSmalltalk
    make parent ...Rebol
    inheritOCaml, Pike
    def child extends makeSuperObject(parent, ...) { ... }E
    type child is new parent with record ... end recordAda
    type child =
      inherit parent
      ...
    F#
    (defclass child (parent) ...)Common Lisp
    @interface child : parent { ... } ... @endObjective-C
    @ISA = qw(parent1 parent2)Perl
    clone , setProtos, setProto, prependProto, appendProtoIo
    instance Parent Child where ...Haskell

  • has the method

    canPerl, Perl6
    respond_to?Ruby
    respondsToE, Smalltalk
    respondsToSelectorObjective-C
    hasattr(obj, "meth")(67)Python
    object->methodPike
    all [in object 'method function? get in object 'method]Rebol
    find-methodCommon Lisp
    ismethodMatlab
    hasSlotIo
    try obj.GetType().GetMethod("meth") with ...F#
    obj.meth? instanceof FunctionCoffeeScript
    method_existsPHP5

  • current instance

    thisBeta, C#, C++, CoffeeScript, Java, JavaScript, PHP, Pike
    THISSimula
    selfIo, Objective-C, Rebol, Ruby, Smalltalk
    object_name if defined as: def object_name { ... }E
    CurrentEiffel
    first parameter(68)Matlab, Perl, Pliant, Python
    the object variableF#
    dispatching parameterAda, Common Lisp
    MeVisual Basic
    .Perl6

  • accessing parent method

    superCoffeeScript, E, Java, Objective-C, Ruby, Smalltalk
    super(Class, self).meth(args)Python
    baseC#
    resendIo
    PrecursorEiffel
    $o.SUPER::method(...)Perl6
    $o->SUPER::method(...)Perl
    method(parent(dispatching-parameter))Ada
    parent(dispatching-parameter).methodAda
    parent::methodPHP5
    call-next-methodCommon Lisp
    type foo2 =
      inherit foo as parent
      ...
      member ... = ... parent.meth
    F#

  • accessing child method

    innerBeta


Package, Module

  • package scope

    .Ada, C#, CoffeeScript, E, F#, Go, Haskell, Java, Modula-3, OCaml, Pascal, Python, Ruby, SML, Squeak
    :XML
    ::C++, merd, Perl, Ruby, Squeak, Tcl, YCP
    : ::(69)Common Lisp
    :-Maple
    'Perl
    `Mathematica
    __Mercury
    /Matlab

  • declare

    package p;Java, Perl
    namespace p { ... }C#, C++
    namespace p ...F#
    namespace P;PHP5
    namespace eval p ...Tcl
    module p where ...Haskell
    module P ... endRuby
    module P = struct ... endOCaml
    { module "p"; ... }YCP
    :- module(p)Prolog
    p = module() ... end moduleMaple
    (defpackage p ...)Common Lisp
    automatically done based on the file nameOCaml, Python, Tcl8.5
    package declare(70)Matlab
    Begin["p`"] ... End[]Mathematica
    BeginPackage["p`"] ... EndPackage[]Mathematica
    <node xmlns="namespace"> ... </node>XML
    package p is
       -- Declare public package members here
    private
       -- Declare private package members here
    end p;
    
    package body p is
     ... -- Define package implementation here
    end p;
    Ada
    package pGo

    selective export

    module p (name1, name2, ...) where ...Haskell
    @ISA = qw(Exporter); @EXPORT = qw(name1 name2 ...);Perl
    package p is ... end; package body p is ... end;Ada
    p = module() export name1, name2, ...; ... end moduleMaple
    (export 'name1 'name2)Common Lisp
    attached to each name (public, private...)Java, Pike
    namespace export name1Tcl
    namespace p
      val name1 : type1
      ...
    F#
    append_featuresRuby
    module type PType = sig val name1 : type1 ... end
    module P : PType  = struct ... end
    OCaml
    all files in package directory are exported. files in /private sub-directory are not exported, but can be used by the package itselfMatlab
    __all__ = [ ... ]Python
    Identifier is only exported if the first character of its name is an Unicode upper case letter; and the identifier is declared in the package block or it is a field name or method name. No other identifiers are exportedGo

  • import

    everything into current namespace

    use p(71)Perl
    uses pPascal
    using pC#
    using namespace p;C++
    (use-package 'p)Common Lisp
    open pF#, OCaml
    importPike
    import pHaskell
    IMPORT p;Modula-2
    import p.*Java
    import "p"YCP
    from p import *Python
    with p; use p;Ada
    namespace import p *Tcl
    inherit c export {NONE} all endEiffel
    include or even extendRuby
    doRebol
    addpathMatlab
    . pBourneShell
    source pBourneShell
    builtin -f /path/to/lib.soKornShell
    << p`Mathematica
    Get["p`"]Mathematica
    Needs["p`"]Mathematica
    use P1\P;PHP5
    use P1\P as Q;PHP5

    selectively

    import p (name1, name2, ...)Haskell
    import p.name1; import p.name2Java
    (import '(p:name1 p:name2))Common Lisp
    use p qw(name1 name2 ...)Perl
    from p import name1, name2, ...Python
    FROM p IMPORT name1, name2, ...;Modula-2
    namespace import p name1Tcl
    using p::name1; using p::name2; ...C++
    with p; use type p.type1; ...Ada
    with(p[name1, name2,])Maple
    def name := <import:p.name>E
    :- use_module(name1, name2, ...)Prolog

    package (ie. load the package)

    import pPython
    use p;(72)Perl
    require pPerl
    require "p"Ruby
    require, "p"Yorick
    (require 'p)(73)Common Lisp
    with p;Ada
    with(p)Maple
    package require pTcl
    automatically done(74)Java, OCaml
    import "p"Go


Strings

  • type name

    char[]C
    char const[]C++
    stringC#, C++, F#, Go, Maple, OCaml, Pascal, PHP, Pike, SML, Vimscript, YCP
    string!Rebol
    StringAda, C#, CoffeeScript, Haskell, Java, JavaScript, merd, Ruby, Smalltalk, Visual Basic
    STRINGEiffel
    strPython, YAML
    StrPerl6, Pliant
    NSString *Objective-C
    CHAR, VARCHAR(size)SQL92
    SequenceIo

  • character type name

    charC, C#, C++, F#, OCaml, SML
    char!Rebol
    CharHaskell, merd, Perl6
    CharacterAda, Smalltalk
    CHARACTEREiffel
    runeGo

  • character "z"

    'z'Ada, B, C, C#, C++, Classic REXX, E, Eiffel, F#, Go, Haskell, Matlab, OCaml, Pascal, Pike
    "z"BourneShell, Classic REXX, Maple, merd
    "zLogo
    $zSmalltalk
    #\zCommon Lisp, Scheme
    #"z"Rebol, SML
    &zOz
    ?zEmacs Lisp, Ruby
    char z, [char] z(75)Forth

  • strings

    with no interpolation of variables

    '...'Beta, BourneShell, Classic REXX, CoffeeScript, CSS, FishShell, JavaScript, Lua, Matlab, Pascal, Perl, Perl6, PHP, Prolog, Python, Ruby, Smalltalk, SQL92, Vimscript, XPath, YAML
    "..."Ada, Awk, C, C#, C++, Classic REXX, Common Lisp, CSS, Dylan, E, Eiffel, Emacs Lisp, F#, FL, Go, Haskell, Io, Java, JavaScript, Lua, Maple, Mathematica, Modula-3, MUMPS, OCaml, Oz, Pike, Pliant, Prolog, Python, Rebol, Scheme, SML, XPath, YAML, YCP
    "...Logo
    '''...'''Python
    """..."""Io, Python
    [[ ... ]]Lua
    R"[ ... ]"C++-0x
    <<'MARK' ... MARKBourneShell, Perl, Ruby
    <<<'MARK' ... MARK(76)PHP5
    {...{...}...}Tcl
    (...)PostScript
    q(...(...)...), q[...], q{...}, q<...>, q/.../Perl, Perl6
    %q(...(...)...), %q[...], %q{...}, %q<...>, %q/.../Ruby
    q(...(...)...)merd
    @"...""..."C#
    s"..."Forth
    @"..."Objective-C

    with interpolation of variables

    ...(77)Tcl
    "... $v ..."BourneShell, FishShell, Perl, Perl6, PHP, Tcl
    "... {v} ..."merd
    "... #{v} ..." "... #$v ..." "... #@v ..." "... #@@v ..."CoffeeScript, Ruby
    <<MARK ... $v ... MARKBourneShell, Perl
    <<MARK ... #{v} ... MARKRuby
    <<<MARK ... $v ... MARKPHP
    qq(...(... $v ...)...), qq[...], qq{...}, qq<...>, qq/.../Perl, Perl6
    %Q(...(... #{v} ...)...), %Q[...], %Q{...}, %Q<...>, %Q/.../Ruby
    qq(...(... {v} ...)...)merd
    "... #{v} ..." interpolateIo
    "... %(v)s ..." % vars()Python

    end-of-line (without writing the real CR or LF character)

    \nTcl
    "\n"C, C#, C++, CoffeeScript, FishShell, Go, Haskell, Io, Java, JavaScript, Lua, Maple, Mathematica, OCaml, Perl, Perl6, PHP, Pike, Python, Ruby, YCP, Yorick
    "*n"B, BCPL
    "%N"Eiffel
    "^/"Rebol
    "~%"(78)Common Lisp
    "[lf]"Pliant
    vb_nlVisual Basic
    <N>(79)Smalltalk

  • multi-line

    all strings allow multi-line stringsBourneShell, Common Lisp, E, Emacs Lisp, F#, FishShell, Io, Maple, Mathematica, OCaml, Pascal, Perl, Perl6, PHP, Ruby, Scheme, Smalltalk, YCP
    "...", {...}Tcl
    @"..."C#
    '''...''', """..."""Python
    [[ ... ]]Lua
    {...}Rebol
    "...\n"
    "...\n"
    C
    ... "...\n\
        \...\n"
    Haskell
    "...",
    "..."
    Classic REXX
    "...%N%
    %...%N"
    Eiffel
    """ ... """CoffeeScript
    `...`Go

  • convert something to a string (see also string interpolation)

    showHaskell
    to_s, to_str, inspect, String()Ruby
    to_stringmerd, Pliant
    tostringLua, YCP
    toStringCoffeeScript, Java, JavaScript
    ToStringC#, F#, Mathematica
    StringCoffeeScript, JavaScript
    perlPerl6
    DumperPerl
    "" . ePerl
    "" ~ ePerl6
    "" + eCoffeeScript, E, Java, JavaScript
    stringPliant, Vimscript
    str, `e`, reprPython
    outEiffel
    cvsPostScript
    T'Image(e)(80)Ada
    asStringIo, Smalltalk
    printStringSmalltalk
    as(<string>, e)Dylan
    (string) ePHP, Pike
    convert(e,string)Maple
    (coerce e 'string)Common Lisp
    prin1-to-stringEmacs Lisp
    to string! / to-string / to ""Rebol
    descriptionObjective-C
    pr1Yorick
    unneeded, all values are stringsTcl
    string(e)Go

  • serialize (marshalling)

    export-clixmlMSH
    serializeIo, PHP
    Marshal.to_stringOCaml
    Marshal.dumpRuby
    Data.Binary.encodeHaskell
    BinaryFormatter.SerializeF#
    storeBinaryOnSmalltalk
    Storable::storePerl
    pickle.dump(81)Python
    (with-standard-io-syntax (write obj stream))Common Lisp
    T'Output(80)Ada

  • unserialize (un-marshalling)

    import-clixmlMSH
    unserializePHP
    Marshal.from_stringOCaml
    Marshal.loadRuby
    Data.Binary.decodeHaskell
    BinaryFormatter.DeserializeF#
    readBinaryFromSmalltalk
    pickle.loadPython
    (with-standard-io-syntax (read obj stream))Common Lisp
    Storable::storePerl
    doStringIo
    T'Input(80)Ada

  • sprintf-like

    sprintfAwk, C, C++, F#, Maple, Matlab, merd, OCaml, Perl, Perl6, PHP, Pike, Ruby
    printfHaskell
    %Python, Ruby
    formatJava, Lua, Tcl
    format(82)Common Lisp, Erlang, Scheme-SRFI28
    FormatC#, F#
    putFormatBeta
    stringWithFormatObjective-C
    expandMacrosWith(82)Smalltalk
    Storable::retrievePerl
    fmt.SprintfGo

  • simple print

    on strings

    putsC, Dylan, Tcl
    printAwk, Basic, Java, Maple, merd, PHP, SML
    writeJavaScript, Pascal, Pike, Yorick
    putStrHaskell
    print_stringF#, OCaml
    consolePliant
    writelnJavaScript, Pascal
    write-stringCommon Lisp
    putStrLnHaskell
    Put_LineAda
    displayCobol
    messageEmacs Lisp
    put_stringEiffel
    showSmalltalk
    print_endline(83)OCaml
    println(83)Java, merd
    put_charsErlang
    echo(84)BourneShell, FishShell, PHP
    typeForth
    putTextBeta
    sayClassic REXX
    p or iGNU-sed
    fmt.PrintGo
    echomVimscript

    on simple objects

    printPerl, Perl6
    say(83)Perl6
    puts(83)Tcl
    puts -nonewlineTcl

    on any objects

    printIo, Logo, Lua, Ruby
    print(83)Dylan, Haskell, Python, Rebol
    PrintMathematica
    print e,Python
    println(83)Io
    prinRebol
    PutAda
    p(83)Ruby
    puts(85)Ruby
    displayScheme
    writeCommon Lisp, Io, Prolog, Scheme
    writeln(83)Io
    printCommon Lisp
    printOnSmalltalk
    princ prin1Common Lisp, Emacs Lisp
    print_anyF#
    WriteLineC#, F#
    nothing - just remove ";" at the end of the expression, and it will print itMatlab
    dispMatlab

    printf-like

    printfAwk, C, C++, F#, Haskell, KornShell, Maple, Matlab, merd, OCaml, Perl, PHP, Ruby
    writePike
    WriteLineC#
    putFormatBeta
    format(82)Common Lisp, Prolog
    fmt.PrintfGo

  • string equality & inequality

    eq nePerl, Perl6, Tcl
    strcmpC, Matlab
    == !=(Vimscript: whether or not == and != are case-sensitive depends on user settings.)CoffeeScript, Go, JavaScript, Pike, Vimscript
    ==? !=?(86)Vimscript
    ==# !=#(87)Vimscript
    == !==PHP
    == ~=Lua
    = \=Prolog
    isEqualToString(88)Objective-C
    == !=Awk, C#, C++, E, Io, merd, Python, Ruby, YCP
    == <>Python
    == /=Haskell
    == \=Oz
    = !=BourneShell, FishShell, Maple, XPath
    = /=Ada
    = \=Classic REXX
    = <>Beta, F#, OCaml, Pliant, SML, Visual Basic
    = ~=Dylan, Smalltalk
    == \== or = <> \=Classic REXX
    === =!= / == !=(20)Mathematica
    == ~=Matlab
    equal?Ruby, Scheme
    equalsJava
    equal, equalpCommon Lisp
    is_equalEiffel
    isEqualObjective-C

  • string size

    lengthAwk, Beta, C++, CoffeeScript, Common Lisp, Eiffel, F#, Haskell, Java, JavaScript, Maple, Matlab, Objective-C, OCaml, Perl, PostScript, Prolog, Ruby
    LENGTHClassic REXX
    'LengthAda
    length?Rebol
    sizeC++, E, Io, Ruby, Smalltalk, SML, YCP
    LengthC#, F#, Modula-3, Oz, Pascal
    lenGo, Pliant, Python, Vimscript, Visual Basic
    strlenC, PHP, Vimscript
    string lengthTcl
    string-lengthScheme, XPath
    StringLengthMathematica
    sizeofPike
    countEiffel, Logo
    bytes charsPerl6
    CHARACTER_LENGTHSQL92
    atom_lengthProlog
    wc -cFishShell
    #Lua
    ${#v}BourneShell
    dup(89)Forth

  • string concatenation

    +C#, C++, CoffeeScript, E, Eiffel, F#, Go, Java, JavaScript, merd, MSH, Pascal, Pike, Pliant, Python, Ruby, YCP
    .Perl, PHP, Vimscript
    ..Io, Lua
    ,Smalltalk
    ~D, Perl6
    &Ada, Modula-3, Visual Basic
    ^F#, OCaml, SML
    _MUMPS
    ||Cecil, Classic REXX, Icon, Maple, PL/I, SQL92
    ++Haskell
    $a$bBourneShell, FishShell, Tcl
    concatenateCommon Lisp, Dylan
    string-appendScheme
    StringJoinMathematica
    catMaple
    CatModula-3
    strcatC
    concatXPath
    appendBeta, Prolog, Rebol
    stringByAppendingStringObjective-C
    Awk, Classic REXX
    [string1 string2]Matlab
    wordLogo

  • duplicate n times

    *Ada, E, Pike, Python, Ruby
    xPerl, Perl6
    timesmerd
    repeatPliant
    repeatedIo
    str_repeatPHP
    string repeatTcl
    strrepLua
    repmatMatlab
    insert/dupRebol
    COPIESClassic REXX
    cat(s$n)Maple
    concat $ replicateHaskell
    strings.RepeatGo

  • upper / lower case character

    upcase / downcaseEmacs Lisp, Ruby
    uc / lcPerl, Perl6
    upper / lower(90)Lua, Matlab, Pliant, Python
    toUpper / toLowerHaskell
    to_upper / to_lowerEiffel
    To_Upper / To_LowerAda
    toUpperCase / toLowerCaseCoffeeScript, E, Java, JavaScript
    upper_case / lower_casePike
    uppercase / lowercaseF#, Logo, OCaml
    strupper / strlowerLua
    strtoupper / strtolowerPHP
    ToUpper / ToLowerC#, F#, Oz
    toupper / tolowerAwk, C, C++
    string toupper / string tolowerTcl
    asLowercase / asUppercaseIo, Smalltalk
    upCase / lowCaseBeta
    uppercase form / lowercase formRebol
    char-upcase / char-downcaseCommon Lisp, Scheme
    char_type(C_, to_upper(C)), char_type(C_, to_lower(C))Prolog
    \U / \L / \CGNU-sed
    unicode.ToUpper / unicode.ToLowerGo

  • uppercase / lowercase / capitalized string

    upcase / downcaseEmacs Lisp, Ruby
    upper / lowerMatlab, SQL92
    upper / lower / capitalizePython
    uppercase/lowercaseF#, Logo, OCaml, Rebol
    upcase_atom/downcase_atomProlog
    toUpperCase / toLowerCaseCoffeeScript, E, Java, JavaScript
    ToUpperCase / ToLowerCaseMathematica
    ToUpper / ToLowerC#, F#
    to_upper / to_lowerAda, Eiffel
    toupper / tolowerAwk, YCP
    uc / lcPerl, Perl6
    UpperCase / LowerCasePascal
    StringTools[UpperCase] / StringTools[LowerCase] / StringTools[Capitalize]Maple
    uppercaseString / lowercaseString / capitalizedStringObjective-C
    UCase / LCaseVisual Basic
    strtoupper / strtolowerPHP, Yorick
    strupper / strlowerLua
    string toupper / string tolower / string totitleTcl
    string-upcase / string-downcaseCommon Lisp, Scheme
    asLowercase / asUppercase / asUppercaseFirstSmalltalk
    asLowercase / asUppercase / makeFirstCharacterUppercaseIo
    upcase_atom / downcase_atomProlog
    makeLC / makeUCBeta
    parse upper var in_var out_var / parse lower var in_var out_varClassic REXX
    strings.ToUpper / strings.ToLower / strings.TitleGo

  • ascii to character

    chrF#, Haskell, OCaml, Pascal, Perl, Perl6, PHP, Python, Ruby, SML
    chr$Visual Basic
    charMatlab
    format %c $cTcl
    toCharE
    strcharLua
    from_integerEiffel
    fromCharCodeCoffeeScript, JavaScript
    FromCharacterCodeMathematica
    characterPliant
    Character value: cSmalltalk
    asCharacterIo
    code-charCommon Lisp
    integer->charScheme
    'ValAda
    (char) cC, C#, C++, Java
    to char! / to-charRebol
    X2C, D2CClassic REXX
    $CHAR(s)MUMPS
    char_codeProlog
    asciiLogo
    StringTools[Char]Maple
    utf8.DecodeRuneInString(s)Go

  • character to ascii

    ordF#, Haskell, Pascal, Perl, Perl6, PHP, Python, SML
    ascVisual Basic
    getNumericValueJava
    charCodeAtCoffeeScript, JavaScript
    asciiValueSmalltalk
    codeEiffel, OCaml
    char-codeCommon Lisp
    char->integerScheme
    s[0]Ruby
    s 0 getPostScript
    s at(0)Io
    scan $s %cTcl
    strbyteLua
    toIntegerE
    'PosAda
    numberPliant
    (int) cC, C#, C++, Java
    to integer! / to-integerRebol
    ToCharacterCodeMathematica
    C2X, C2DClassic REXX
    $ASCII(s)MUMPS
    (done automatically when applying mathematical operations on char, such as +)Matlab
    charLogo
    char_codeProlog
    StringTools[Ord]Maple
    string(c)Go

  • accessing n-th character

    s[n]C, C#, C++, E, Go, Maple, PHP, Pike, Python, Ruby, Vimscript
    s(n)Ada, Matlab
    s:nPliant
    s.[n]F#, OCaml
    s !! nHaskell
    s @ nEiffel
    s/:nRebol
    string index s nTcl
    subSML
    char, aref, schar, svrefCommon Lisp
    GetCharModula-3
    s at(n)Io
    at(91)C++, Smalltalk
    arefCommon Lisp
    char(s, i)B
    charAtCoffeeScript, Java, JavaScript
    characterAtIndexObjective-C
    n -> s.inxGetBeta
    string-refScheme
    StringTake[s, {n}]Mathematica
    $EXTRACT(s, n)MUMPS
    itemLogo
    over n chars + c@Forth
    s/.{n}(.).*/\1/GNU-sed

  • extract a substring

    s[n..m]CoffeeScript, Maple, Pike, Ruby
    s.[n..m]F#
    s(n..m)Ada
    s(n:m)Matlab
    s(n,m+1)E
    s[n:m+1]Go, Python, Vimscript
    s[n,len]Ruby
    s n lenPliant
    strndup(s + n, len)C
    substringEiffel, Java, Scheme, SML, XPath, YCP
    SubstringC#
    substrC++, Perl, Perl6, PHP
    SUBSTRClassic REXX
    subF#, Lua, OCaml
    SUBModula-3
    subseqCommon Lisp
    sliceCoffeeScript, Io, JavaScript
    mid$JavaScript
    string rangeTcl
    StringTake[s, {n, m}]Mathematica
    strpart(s, n, m)Yorick
    copy/part at s n lenRebol
    copy/part at s n at s mRebol
    s copyFrom: n to: mSmalltalk
    (n,m)->s.subBeta
    [s substringWithRange:NSMakeRange(n, len)]Objective-C
    SUBSTRING(s FROM n len)SQL92
    $EXTRACT(s, n, m)MUMPS
    sub_string / sub_atomProlog
    (take len . drop n) sHaskell
    over n chars + lenForth
    s/.{n}(.{len}).*/\1/GNU-sed

  • locate a substring

    indexAda, Perl, Perl6, Python, Ruby
    indexOfCoffeeScript, Java, JavaScript
    IndexOfC#, F#
    indexOfStringSmalltalk
    startOfE
    searchCommon Lisp, Pike, PostScript
    StringTools[Search]Maple
    StringPositionMathematica
    strstr strchrC
    findC++, Logo, Lua, Python, Rebol, YCP
    findSeqIo
    findSubstringHaskell
    strfindMatlab, Yorick
    strposPHP
    $FINDMUMPS
    index_non_blank / find_tokenAda
    substring_indexEiffel
    rangeOfStringObjective-C
    POSClassic REXX
    POSITION(needle IN s)SQL92
    sub_string / sub_atomProlog
    string firstTcl
    strings.IndexGo

  • locate a substring (starting at the end)

    rindexOCaml, Perl, Perl6, Python, Ruby
    rfindC++, Python
    find/lastRebol
    strrchrC
    index(Going => Backward)Ada
    lastStartOfE
    lastIndexOfCoffeeScript, Java, JavaScript
    last_index_of(92)Eiffel
    LastIndexOfC#, F#
    lastIndexOfStringSmalltalk
    string lastTcl
    (search substring string :from-end t)Common Lisp
    [string rangeOfString:substring options:NSBackwardsSearch]Objective-C
    LASTPOSClassic REXX
    t=strfind(s,p), t(end)Matlab
    strrposPHP
    StringTools[SearchAll](s,p)[-1]Maple
    strings.LastIndexGo


Booleans

  • type name

    BoolHaskell, Perl6, Pliant
    boolC#, C++, C99, F#, Go, OCaml, PHP, Python, SML, YAML
    BooleanAda, Lua, Pascal, Smalltalk, Visual Basic
    booleanCoffeeScript, Common Lisp, Java, JavaScript, Maple, PHP, YCP
    BOOLEANEiffel
    logic!Rebol
    logicalMatlab

  • false value

    falseAda, BCPL, Beta, BourneShell, C#, C++, C99, CoffeeScript, E, F#, FL, Forth, Go, Io, Java, JavaScript, Logo, Lua, Maple, Matlab, OCaml, Oz, Pascal, PHP, Pliant, PostScript, Rebol, Ruby, Smalltalk, SML, Tcl, YAML, YCP
    FalseEiffel, Haskell, Mathematica, merd, Python, Visual Basic
    FALSEModula-3, SQL92
    false()XPath
    #fDylan, Scheme
    nYAML
    nilCommon Lisp, Emacs Lisp, Io, Lua, Ruby
    noCoffeeScript, Tcl, YAML
    NoProlog
    noneRebol
    NonePython
    nullCoffeeScript, JavaScript
    NULLC, C++, C99, PHP
    offCoffeeScript, Tcl, YAML
    undefPerl, Perl6
    undefinedCoffeeScript, JavaScript
    failProlog
    FAILMaple
    array containing at least one false valueMatlab
    exit status different from 0BourneShell
    0(93)Awk, B, C, C++, C99, Classic REXX, CoffeeScript, Forth, JavaScript, Matlab, MUMPS, Perl, Perl6, PHP, Pike, Python, Tcl, Visual Basic, XPath, Yorick
    0.0Matlab, Perl, PHP
    NaNCoffeeScript, JavaScript, XPath
    ""Awk, CoffeeScript, JavaScript, Perl, Perl6, PHP, Python, XPath
    "0"Awk, Perl, Perl6, PHP
    ''CoffeeScript, Matlab, Perl
    '\0'C, C++, C99
    ()Perl, Perl6, Python
    []Matlab, Python
    {}Matlab, Python
    array()PHP

  • true value

    TRUEModula-3, SQL92
    TrueEiffel, Haskell, Mathematica, merd, Python, Visual Basic
    trueAda, BCPL, Beta, BourneShell, C#, C++, CoffeeScript, E, F#, FL, Forth, Go, Io, Java, JavaScript, Logo, Maple, OCaml, Oz, Pascal, PHP, Pliant, PostScript, Prolog, Rebol, Ruby, Smalltalk, SML, Tcl, YAML, YCP
    true()XPath
    tCommon Lisp, Emacs Lisp
    #tDylan, Scheme
    yYAML
    yesCoffeeScript, Tcl, YAML
    YesProlog
    onCoffeeScript, Tcl, YAML
    exit status 0BourneShell
    anything not falseAwk, B, C, C++, Common Lisp, Dylan, Emacs Lisp, Matlab, MUMPS, Perl, Perl6, Pike, Python, Rebol, Ruby, Scheme, XPath, Yorick
    1Classic REXX, MUMPS
    non zero numberTcl
    non-zero-numbersVisual Basic
    -1Forth

  • logical not

    !Awk, B, C, C#, C++, CoffeeScript, E, Go, Java, JavaScript, Mathematica, Perl, Perl6, PHP, Pike, Ruby, Tcl, Vimscript, YCP, Yorick
    not(94)Ada, Beta, CoffeeScript, Common Lisp, Eiffel, Emacs Lisp, F#, Haskell, Io, Logo, Lua, Maple, merd, OCaml, Pascal, Perl, Perl6, Pliant, PostScript, Prolog, Python, Rebol, Ruby, Scheme, Smalltalk, SML, XPath
    NotOz, Visual Basic
    NOTModula-3
    ~BCPL, Dylan, Matlab, PL/I
    ^PL/I
    'MUMPS
    \Classic REXX
    =0Forth

  • logical or / and

    short circuit

    || / &&Awk, C, C#, C++, CoffeeScript, E, F#, Go, Haskell, Java, JavaScript, Mathematica, Matlab, merd, OCaml, Perl, Perl6, PHP, Pike, Ruby, Tcl, Vimscript, YCP, Yorick
    | / &B, BCPL, Dylan
    or / andCoffeeScript, Common Lisp, Emacs Lisp, Io, Logo, Lua, Modula-2, Perl, Perl6, PHP, Pliant, Python, Ruby, Scheme, Smalltalk
    OR / ANDModula-3
    or / &(95)Modula-2
    any / allRebol
    orelse / andalsoSML
    orelse / andthenOz
    or else / and thenAda, Eiffel
    ; / ,Prolog
    & / !MUMPS

    non short circuit (always evaluates both arguments)

    | / &C#, Classic REXX, Java, Matlab, Smalltalk
    or / andAda, Beta, Eiffel, Maple, Pascal, PostScript, Rebol, SML, XPath
    Or / And(96)Oz, Visual Basic
    \/ / /\(15)BCPL
    ?| /Perl6


Bags and Lists

  • type name

    seqYAML
    a listF#, OCaml, SML
    [a]Haskell
    a[]C#
    listMaple, Python
    ListIo, Mathematica, Pliant
    Array or ListPerl6
    ARRAY or LINKED_LISTEiffel
    Array or OrderedCollectionSmalltalk
    ARRAYPerl
    arrayPHP
    cellMatlab
    vectorC++
    Containers.Vectors.Vector or Ada.Containers.Doubly_Linked_Lists.ListAda
    []aGo

  • list concatenation

    +E, Eiffel, merd, PHP, Pike, Python, Ruby, Vimscript
    ,Maple, Matlab, Perl, Smalltalk
    @F#, OCaml, SML
    ~D
    &Ada
    ++Haskell
    |||Icon
    array_mergePHP
    mergeYCP
    concatCoffeeScript, JavaScript, Tcl
    concatenateDylan
    nconcCommon Lisp, Emacs Lisp
    appendBeta, Common Lisp, Emacs Lisp, Go, Prolog, Rebol, Scheme
    AppendOz
    appendSeqIo
    arrayByAddingObjectsFromArrayObjective-C
    sentenceLogo
    JoinMathematica

  • list flattening

    one level depth

    concatF#, Haskell, Mercury, SML
    flattenF#, Io, merd, OCaml, Prolog, YCP
    FlattenOz
    eval concatTcl
    ListTools[FlattenOnce]Maple
    {*}$lTcl8.5
    "$l"FishShell

    recursive

    flattenPike, Ruby
    ListTools[Flatten]Maple
    FlattenMathematica

  • list constructor

    [ a, b, c ](97)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 }(98)C, C++, Lua, Mathematica
    #(a, b, c)Dylan
    #(a b c)(99)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
    listCommon 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)(100)JavaScript
    [NSArray arrayWithObjects:a, b, c, nil]Objective-C
    set l a b cFishShell
      - a
      - b
      - c
    YAML
    []t{a, b, c}Go

  • list/array indexing

    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 versionBCPL
    a[[i]]Mathematica
    a[i]:defaultYCP
    a(i)Ada, Matlab
    a:iPliant
    a/:iRebol
    a.(i)F#, OCaml
    a.[i]F#
    a !! iHaskell, Mercury
    a @ iEiffel
    a i get(101)PostScript
    a at(i)Io
    at(102)C++, Smalltalk
    lindexTcl
    nthCommon Lisp, Emacs Lisp, OCaml
    NthOz
    arefCommon Lisp, Emacs Lisp
    nth0 / nth1Prolog
    list-ref / vector-refScheme
    elementDylan
    sliceRuby
    node[i]XPath
    objectAtIndexObjective-C
    itemLogo
    a i cells + @ (for write access: o a i cells + !Forth

  • adding an element at the beginning (list cons)

    return the new list (no side-effect)

    :Haskell, merd
    ::F#, OCaml, SML
    |Oz
    [ e | l ]Erlang, Prolog
    [e l[]]Maple
    [e l]Matlab
    consCommon Lisp, Emacs Lisp, Scheme
    pairDylan
    fputLogo
    PrependAda, Mathematica

    side-effect

    unshiftCoffeeScript, JavaScript, Perl, Perl6, Ruby
    prependYCP
    push_frontC++
    addFirstSmalltalk
    insertRebol
    put_firstEiffel
    pushCommon Lisp, Io
    array_unshiftPHP
    PrependToMathematica

  • adding an element at index

    return the new list (no side-effect)

    linsert l i eTcl
    InsertAda, 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: iSmalltalk
    splice(@a, $i, 0, $e)Perl

  • adding an element at the end

    return the new list (no side-effect)

    [l e]Matlab
    pushmerd
    arrayByAddingObjectObjective-C
    lputLogo
    linsert l end eTcl
    AppendAda, Mathematica

    side-effect

    pushCoffeeScript, JavaScript, Perl, Perl6, Ruby
    push_backC++
    appendGo, Io, Pliant, Python, Rebol
    AppendToMathematica
    lappendTcl
    +=Pliant
    addJava, Smalltalk, YCP
    put_lastEiffel
    array_pushPHP
    addObjectObjective-C

  • first element

    headHaskell
    HeadF#
    hdF#, OCaml
    carCommon Lisp, Emacs Lisp, Scheme
    firstEiffel, Io, Logo, Pliant, Rebol, Smalltalk
    First(103)Mathematica
    First_ElementAda

    iterator

    headBeta
    beginC++
    FirstAda

  • all but the first element

    tailHaskell
    TailF#
    tlF#, OCaml
    cdrCommon Lisp, Emacs Lisp, Scheme
    RestMathematica
    butfirstLogo
    allButFirstSmalltalk
    l[1:]Go, Python
    a(2:end)Matlab
    L = [_|ButFirst]Prolog
    lrange l 1 endTcl

  • last element

    lastE, Eiffel, Haskell, Io, Logo, Pliant, Prolog, Rebol, Scheme, Smalltalk
    LastMathematica, Oz
    lastObjectObjective-C
    a[-1]Perl, Pike, Python, Ruby
    a(end)Matlab
    node[last()]XPath
    (car (last l))Common Lisp, Emacs Lisp
    lindex l endTcl
    Last_ElementAda
    l[len(l)-1:]Go

    iterator

    LastAda

  • all but the last element

    MostMathematica

  • get the first element and remove it

    shiftCoffeeScript, JavaScript, Perl, Perl6, Ruby
    shift!merd
    popCommon Lisp, Logo
    removeFirstIo, Smalltalk
    array_shiftPHP

  • get the last element and remove it

    popCoffeeScript, E, Io, JavaScript, Perl, Perl6, Python, Ruby
    pop!merd
    array_popPHP
    removeLastIo, Smalltalk
    dequeueLogo

  • for each element do something

    eachmerd, Pliant, Ruby
    for v in l ...CoffeeScript, E, Maple, Ruby
    for v in l: ...Python
    for v in l; do ...; doneBourneShell
    for v in l do ...F#
    for v in l; ...; endFishShell
    for (v in l) ...Awk, Dylan
    for (var v in l) { ... }JavaScript
    For Each v in l ... NextVisual Basic
    for v in range loop .. end loopAda
    forPerl
    foreachLogo, 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_eachC++
    for-eachScheme
    forallPostScript, Prolog
    ForAllOz
    iterF#, OCaml
    doSmalltalk
    do_allEiffel
    appSML
    mapcEmacs Lisp
    mapM_Haskell
    ScanMathematica
    (dolist (v l) ...) (loop for v in l do ...) mapcCommon Lisp
    list.iterate (# do current ... #)Beta
    l.Iterate(...)F#
    IterateAda
    for i, v := range l {...}Go

  • transform a list (or bag) in another one

    mapDylan, F#, Haskell, Io, Maple, Mercury, merd, OCaml, Perl, Pike, Python, Ruby, Scheme, SML
    MapF#, Mathematica, Oz
    mapcarCommon Lisp, Emacs Lisp
    maplistProlog, YCP
    sublistProlog
    map / map.seLogo
    for-eachXSLT
    foreach or selectedMSH
    collectRuby, Smalltalk
    transformC++
    array_mapPHP
    /@Mathematica
    [ f x | x <- l ](104)Haskell
    [ f(x) for x in l ](104)Python
    magical: sin(x) computes sin on each elementMatlab

  • transform two lists in parallel

    map2F#, OCaml
    zipWithHaskell
    ZipMaple, Oz
    mapDylan, Logo, Python, Scheme
    map.seLogo
    mapcarCommon Lisp
    maplist2Prolog
    l1 with: l2 collect: ...Smalltalk
    transformC++
    ListPair.mapSML
    magical: a binary function or operator is appliied on each elementMatlab

  • find an element

    findC++, Common Lisp, F#, Haskell, merd, OCaml, Rebol, Ruby, Scheme-SRFI1, SML, YCP
    FindAda
    find_ifC++
    find-ifCommon Lisp
    first(22)Perl
    detectRuby, Smalltalk
    searchPike
    ListTools[Search]Maple
    lsearch -exactTcl
    indexPython
    indexOfIo
    indexOfObject, indexOfObjectIdenticalToObjective-C
    find(a == 3)Matlab
    PositionMathematica

  • keep elements

    matching

    find_allF#, OCaml, Ruby
    filterF#, Haskell, Mercury, merd, OCaml, Pike, Python, Scheme-SRFI1, SML, YCP
    filter!Scheme-SRFI1
    FilterOz
    grepPerl, Perl6
    whereMSH
    selectIo, Maple, Ruby, Smalltalk
    Select / CaseMathematica
    selectInPlaceIo
    remove-if-not delete-if-notCommon Lisp
    chooseDylan
    array_filterPHP5
    [ x | x <- l, p x ](104)Haskell
    [ x for x in l if p(x) ](104)Python
    a(a == 3)Matlab

    non matching

    remove-if delete-ifCommon Lisp
    rejectRuby

  • partition a list: elements matching, elements non matching

    partitionF#, Haskell, merd, OCaml, Ruby, Scheme-SRFI1, SML
    partition!Scheme-SRFI1
    PartitionOz

  • split a list

    in 2 based on a predicate

    breakHaskell
    spanHaskell

    into sublists delimited by elements matching a predicate

    split-sequence(105)Common Lisp
    ListTools[Split]Maple

    into a list of lists of same value

    groupHaskell
    SplitMathematica

    into sublists based on a predicate

    groupByHaskell
    SplitMathematica

  • is an element in the list

    member?Dylan, merd, Ruby
    include?Ruby
    memF#, OCaml
    memberCommon Lisp, Prolog, Scheme
    MemberOz
    MemberQMathematica
    memq memvScheme
    memberp / member?Logo
    containsE, Io, YCP
    containsObjectObjective-C
    inCoffeeScript, JavaScript, Python, SQL92, Tcl8.5
    in_arrayPHP
    includesSmalltalk
    elemHaskell, Mercury
    hasEiffel
    has_valuePike
    ismemberMatlab
    /elt/GNU-sed

  • is the predicate true for an element

    any(31)Haskell, Matlab, Mercury, Python, Scheme-SRFI1
    any?Dylan, Ruby
    anySatisfySmalltalk
    existsF#, OCaml, SML
    exists?merd
    someCommon Lisp
    SomeOz
    ormapMaple
    detectIo

  • is the predicate true for every element

    all(31)Haskell, Mercury, Python, SML
    AllOz
    all?merd, Ruby
    allSatisfySmalltalk
    everyCommon Lisp, Scheme-SRFI1
    every?Dylan
    for_allF#, OCaml
    andmapMaple

  • smallest / biggest element

    min / maxCommon Lisp, Eiffel, Io, Java, Maple, Matlab, Perl6, PHP5, Pike, Prolog, Python, Ruby, Scheme, Smalltalk
    Min / MaxMathematica
    minimum / maximumHaskell, Mercury, merd
    minimum-of / maximum-ofRebol
    min minstr / max maxstr(22)Perl
    min_element / max_elementC++

  • join a list of strings in a string using a glue string

    join(s, l)Perl, Perl6, PHP
    String.Join(s, l)C#
    s.join(l)Python
    l.join(s)CoffeeScript, JavaScript, Perl6, Ruby
    l asStringWith: sSmalltalk
    join l sTcl
    implode(s, l)PHP
    ListTools[Join]Maple
    rjoinE
    joinIo
    concatF#, OCaml
    strcatMatlab
    concat_atomProlog
    l * sPike, Ruby
    (mapconcat 'identity l s)Emacs Lisp
    componentsJoinedByStringObjective-C
    intercalateHaskell
    StringJoin @@ Riffle[l, s]Mathematica
    strings.JoinGo

  • list size

    sizeC++, Dylan, E, Io, Java, Matlab, merd, Pliant, Ruby, Scilab, Smalltalk, YCP
    sizeofPike
    lengthC#, CoffeeScript, Common Lisp, Emacs Lisp, F#, Haskell, Java, JavaScript, Matlab, Mercury, OCaml, PostScript, Prolog, Ruby, Scheme, SML
    LengthAda, F#, Mathematica, Oz
    length?Rebol
    lenPython, Vimscript
    llengthTcl
    $LENGTHMUMPS
    elemsPerl6
    getnLua
    countEiffel, FishShell, Objective-C, PHP, SQL92, XPath
    numelMatlab
    scalar @lPerl
    nopsMaple
    #Lua
    len(l)Go

  • iterate with index

    each_with_indexmerd, Ruby
    enumerate(l)Python
    foreach($l as $i => $v)PHP
    a foreach(i, e, ...)Io
    for i => v in lE
    for (v in l, i from 0) ... endDylan
    forAllIndOz
    foreachiLua
    foreach(l; typ0 i; typ1 v) { ... }Pike
    withIndexDoSqueak
    iteriF#, OCaml
    IterateIndexedF#
    MapIndexedMathematica
    (loop for v in l as i upfrom 0 do ...)Common Lisp
    for v,i in l ...CoffeeScript
    for i, v := range l {...}Go

  • remove duplicates

    uniqmerd, Perl6, Pike, Ruby
    uniq!Ruby
    uniq2Pike
    unique(106)C++, Io, Matlab, Rebol
    nubHaskell
    array_uniquePHP
    ListTools[MakeUnique]Maple
    delete-duplicatesCommon Lisp, Scheme-SRFI1
    delete-duplicates!Scheme-SRFI1
    remove-duplicatesCommon Lisp, Dylan
    lsort -uniqueTcl
    tosetYCP
    distinctSQL92
    setPython
    UnionMathematica

  • sort

    sort(107)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
    sortedPython
    SortMathematica, Oz
    sort_bymerd, Ruby
    sortByHaskell, Io, Smalltalk
    order bySQL92
    lsortTcl
    asortAwk
    sort-objectMSH
    sortedArrayUsingSelector, sortUsingSelectorObjective-C
    predsort / keysort / mergesortProlog

  • reverse

    reverseC++, CoffeeScript, Common Lisp, Dylan, Emacs Lisp, Haskell, Io, Java, JavaScript, Logo, Mercury, merd, Perl, Perl6, Pike, Prolog, Python, Rebol, Ruby, Scheme
    ReverseC#, Mathematica, Oz
    reversedPython, Smalltalk
    reverse_copyC++
    revF#, OCaml, SML
    Reverse_ElementsAda
    lreverseTcl8.5
    array_reversePHP
    ListTools[Reverse]Maple
    fliplr flipud...Matlab
    l[::-1]Python

  • list of couples from 2 lists

    combineF#, OCaml
    zipF#, Haskell, Maple, merd, Perl6, Python, Ruby, Scheme-SRFI1, SML
    pairlis(108)Common Lisp
    transposeRuby
    TransposeMathematica
    [a b]Matlab

  • 2 lists from a list of couples

    splitF#, OCaml
    unzipF#, Haskell, merd, SML
    unzip2Scheme-SRFI1
    transposeRuby
    TransposeMathematica
    zip(*l)Python
    a(1,:), a(2,:)Matlab

  • lookup an element in a association list

    lookupHaskell
    assocCommon Lisp, Emacs Lisp, F#, OCaml, Ruby, Scheme
    assqEmacs Lisp, Scheme
    assvScheme
    get_assocProlog
    selectRebol
    a.(e)Matlab
    a[e]Maple
    gpropLogo
    /.Mathematica

  • list out of a bag

    to_aRuby
    toArrayJava
    asArraySmalltalk
    to_listmerd
    listPython
    map-as(<list>, bag)Dylan
    [a.(:)]Matlab
    array getTcl

  • f(... f(f(init, e1), e2) ..., en)

    foldlHaskell, Maple, Mercury, merd, SML
    FoldLOz
    fold_leftOCaml
    foldF#, Scheme-SRFI1
    FoldMathematica
    reduce(109)Common Lisp, Dylan, Io, Perl, Perl6, Pike, Python
    injectRuby
    inject intoSmalltalk

  • f(e1, f(e2, ... f(en, init) ...))

    foldrHaskell, Maple, Mercury, merd, SML
    FoldROz
    fold-rightScheme-SRFI1
    fold_rightOCaml
    foldBackF#
    rreducePike
    (reduce f '(e1 e2 ... en) :from-right t :initial-value init)Common Lisp
    reverseReduceIo


Various Data Types

  • tuple type

    typ1 * ... * typnF#, OCaml, SML
    (typ1, ..., typn)Haskell
    typ1, ..., typnmerd
    tuplePython
    tuple!Rebol
    Tuple[Typ1, Typ2, Typ3]E
    tuple< typ1, ..., typn >C++-0x

  • tuple constructor

    a, b, cF#, Lua, merd, OCaml, Python, Ruby
    ( a, b, c )Ada, C++-0x, Haskell, Perl, Prolog, SML
    { a. b. c }Smalltalk
    { a, b, c }Matlab
    [ a, b, c ]E
    a . b . cRebol
    (cons a b)Common Lisp

  • computable tuple (these are a kind of immutable lists playing a special role in parameter passing)

    empty tuple

    ()merd, Perl, Perl6, Python
    []Ruby
    {}Matlab, Smalltalk
    #()Smalltalk
    NothingProlog

    1-uple

    a or [a]Ruby
    a,Perl6, Python
    tuple([a])Python
    (a)Perl
    ((a))merd
    {a}Smalltalk

    using a tuple for a function call

    tmerd, Perl
    *tPython, Ruby
    t{:}Matlab
    f @@ tMathematica
    L =.. [ F | Args ], call(L)Prolog

  • reference (pointer)

    creation

    &B, C, C#, C++, Go
    \Perl
    AddressOfVisual Basic
    addr(110)Pascal
    @(110)Pascal
    lvBCPL
    refC#, F#, OCaml, SML
    newSTRefHaskell
    NewCellOz
    variableForth
    'accessAda
    :> :>>Pliant
    ''Maple

    dereference

    *(111)B, C, C#, C++, Go
    $ @ % &(111)Perl
    ->[...] ->{...} ->(...)(112)Perl
    ->(113)C, C++
    ^(112)Modula-3, Pascal
    !(111)F#, OCaml, SML
    rvBCPL
    readSTRefHaskell
    AccessOz
    .[all]Ada
    @Forth
    evalMaple
    (reg)Assembler

    assigning (when dereferencing doesn't give a lvalue)

    writeSTRefHaskell
    AssignOz
    :=F#, OCaml, SML
    !Forth

  • optional value

    null value

    0(114)C++, Forth
    0 nullptr(114)C++-0x
    NULLC, Maple, SQL92
    nilCommon Lisp, Emacs Lisp, Io, Lua, Objective-C, Ruby, Smalltalk
    nullC#, CoffeeScript, Java, JavaScript
    Null(115)Ada, Mathematica
    undefPerl
    NoneF#, OCaml, Python
    NONESML
    NothingHaskell
    VoidEiffel
    #f ()Emacs Lisp
    (empty) / ~ / nullYAML

    value

    vAda, C#, CoffeeScript, Common Lisp, Eiffel, Emacs Lisp, Java, JavaScript, Lua, Perl, Perl, Python, Ruby, Scheme, Smalltalk
    *v(114)C, C++
    Just vHaskell
    Some vF#, OCaml
    SOME vSML

    type name

    optionF#, OCaml, SML
    MaybeHaskell

    null coalescing

    COALESCESQL92
    ?:PHP
    ||JavaScript, Perl, Ruby
    //(116)Perl
    ??C#
    if(a, b)Visual Basic
    orPython, Scheme

  • record

    type declaration

    struct { typ1 n1; typ2 n2; ... }C, C++
    type typ = { n1 : typ1; n2 : typ2 }OCaml, SML
    data Typ = N0 { n1, n2 :: typ1, n3 :: typ3, ... }Haskell
    type Typ is record
      N1 : Typ1;
      N2 : Typ2 := default_val;
      ...
    end record;
    Ada
    type typ struct{ n1 typ1; n2 typ2; }Go

    selector

    .Ada, Beta, C, C#, C++, CoffeeScript, E, Eiffel, F#, Go, Java, JavaScript, Lua, Matlab, Modula-2, Modula-3, OCaml, Oz, Pascal, Python, Ruby
    ::XPath
    %Fortran90
    '(117)Ada
    ^Mercury
    r { field }merd
    r:fieldPliant
    field rHaskell
    ->C, C++
    r[field]Maple
    r["field"]JavaScript
    #field rSML
    normal function callCommon Lisp, Dylan, Haskell, Io, Smalltalk

  • union type declaration

    union { typ1 n1; typ2 n2; ... }C, C++
    data Typ = N1 typ1 | N2 typ2 | ...Haskell
    type typ = N1 of typ1 | N2 of typ2 | ...OCaml
    datatype typ = N1 of typ1 | N2 of typ2 | ...SML
    type Typ (Choice : Discrete_Type) is record
      case Choice is
         when Choice_1 =>
             N1 : Typ1;
             ...
         when Choice_2 | Choice_3 =>
             ...
         when others =>
            ...
      end case;
    end record;
    Ada

  • enumerated type declaration

    enum typ { n1; n2; ... }(118)C, C#, C++, Java
    Enum typ
       n1
       n2
    End Enum
    Visual Basic
    (n1, n2, ...)Pascal
    type typ is(119)Ada
    data Typ = N1 | N2 | ...Haskell
    type typ = N1 | N2 | ...OCaml
    datatype typ = N1 | N2 | ...SML

  • dictionary

    type name

    mapGo, YAML
    MapF#, Io
    std::mapC++
    dictPython
    DictionaryPliant, Smalltalk
    dictionaryVimscript
    HashPerl6, Ruby
    HASHPerl
    HASH_TABLEEiffel
    HashTableJava
    HashtblF#
    Hashtbl.tOCaml
    structMatlab
    tableMaple
    arrayPHP
    Data.Map, Data.HashTableHaskell
    Containers.Ordered_Maps.MapAda

    constructor

    [ a => b, c => d ]E
    array( a => b, c => d )PHP
    { a => b, c => d }Perl, Perl6, Ruby
    { a, b, c, d }Perl, Ruby
    { a: b, c: d }CoffeeScript, JavaScript, Python, Vimscript, YAML
    { a: b; c: d }CSS
    $[ a: b, c: d ]YCP
    { a->b. c->d }Squeak
    { a = b, c = d }Lua
    @{ a = b; c = d }MSH
    ([ a:b, c:d ])Pike
    ([a]=b [c]=d)KornShell
    << a b c d >>PostScript
    struct(a, b, c, d)Matlab
    Hash[ a, b, c, d ]Ruby
    Map.of_list [a, b; c, d]F#
    Hashtbl.of_list [a, b; c, d]F#
    table([a=b, c=d])Maple
    define table foo a => b; c => d endDylan
    dict create a b c dTcl8.5
    new t { {a, b}, {c, d} }C#
    fromListHaskell
    [NSDictionary dictionaryWithObjectsAndKeys:b, a, d, c, nil]Objective-C
      a: b
      c: d
    YAML
    map[typ0]typ1{ a: b, c: d }Go

    access: read/write

    h[k]Awk, C#, C++, CoffeeScript, Dylan, E, Go, JavaScript, Lua, Maple, MSH, PHP, Python, Ruby, Vimscript
    $h{k}Perl
    %h{k} or %h<s>Perl6
    h(k)Tcl
    h.[k]F#
    h.kCoffeeScript, JavaScript, Lua, Matlab
    h:kPliant
    h["k"] or h->kPike
    (gethash k h)Common Lisp

    access: read

    h k getPostScript
    findF#, OCaml
    fetchRuby
    getJava
    dict getTcl8.5
    atIo, Smalltalk
    h@k or h.at(k)Eiffel
    h[k]:defaultYCP
    ${h[k]}KornShell
    h.get(k, returned_value_when_k_unfound)Python
    objectForKeyObjective-C
    lookupHaskell
    ElementAda

    access: write

    h k o putPostScript
    putEiffel, Java
    add, replaceF#, OCaml
    storeRuby
    dict setTcl8.5
    h[k]KornShell, YCP
    atPutIo
    h at: k put: oSmalltalk
    [h setObject:o forKey:k]Objective-C
    insertHaskell
    Replace_ElementAda

    has the key ?

    exists $h{k}Perl
    existsPerl6, Pliant
    dict existsTcl8.5
    hasEiffel
    haskeyYCP
    hasKeyIo
    has_keyPython, Vimscript
    has_key?, include?, key?, member?Ruby
    ContainsAda, C#, F#
    containsKeyJava
    includesKeySmalltalk
    k in hCoffeeScript, JavaScript, Python
    k not in hPython
    inAwk
    memF#, OCaml
    memberHaskell
    isfieldMatlab
    find(120)C++
    h[k]Pike
    (gethash k h)Common Lisp
    mapsE
    knownPostScript
    isset(h[k]), array_key_exists(k, h)PHP
    v, exists := h[k]Go

    remove by key

    delete $h{k}Perl
    del h[k]Python
    unset(h[k])PHP
    removeEiffel, F#, Java, OCaml, YCP
    RemoveC#, F#
    dict removeTcl8.5
    removeAtIo
    removeKeyE, Smalltalk
    remhashCommon Lisp
    deleteCoffeeScript, Haskell, JavaScript, Perl6, Ruby
    DeleteAda
    eraseC++
    m_deletePike
    removeObjectForKeyObjective-C
    undefPostScript
    rmfieldMatlab
    delete(h, k)Go

    list of keys

    keysHaskell, Io, Maple, MSH, Perl, Perl6, Python, Ruby, Smalltalk
    dict keysTcl8.5
    keySetJava
    allKeysObjective-C
    AllKeysC#
    indicesPike
    current_keysEiffel
    getKeysE
    array_keysPHP
    fieldnamesMatlab
    findall(Key, item(Key, _), Keys)Prolog
    ${!h[@]}KornShell

    list of values

    valuesIo, Java, Perl, Perl6, Pike, Python, Ruby, Smalltalk
    dict valuesTcl8.5
    getValuesE
    contentEiffel
    array_valuesPHP
    struct2cellMatlab
    entriesMaple
    elemsHaskell
    ${h[@]}KornShell

    merge

    merge(121)Ruby
    array_merge(121)PHP
    union(122)Haskell
    update(121)Python, Ruby
    putAll(121)Java
    insert(122)C++
    (%h1, %h2)(121)Perl

  • range

    inclusive .. inclusive

    a .. bAda, E, merd, MSH, Pascal, Perl, Ruby
    a:bMatlab
    [ a .. b ]CoffeeScript, F#, Haskell
    toIo, Smalltalk
    seq a b / jot - a b(123)BourneShell, FishShell
    {a..b}KornShell
    rangePHP
    range(from: a, to: b, by: step)Dylan
    RangeMathematica
    Range withIo
    List.number A B StepOz
    numlist / betweenProlog
    iseqLogo
    k, v := range hGo

    inclusive .. exclusive

    a ... bCoffeeScript, Ruby
    a ..! bE
    rangePython


Mathematics

  • type name

    integers

    short, int, longC, C#
    intOCaml, PHP, SML, YAML
    IntPerl6
    Int, uInt, Int8, Int16...Pliant
    int, long(124)Python
    integerMaple, PHP
    INTEGER, INT, SMALLINTSQL92
    INTEGER, INTEGER_8, NATURAL_8...Eiffel
    int8, uint8, int16, uint16, ...64Go, Matlab
    int8_t, uint8_t, int16_t, uint16_t, ...64C99
    int, int8, uint8, int16, uint16, int32, uint32, int64, uint64, bigint, bignumF#
    Int, Integer, Int8, Int16, Int32, Int64Haskell
    Integer, FixNum, BigNumRuby
    Integer, SmallInteger, LargeIntegerSmalltalk
    IntegerMathematica
    type T is range Low...High;Ada
    numberVimscript

    floating point

    float, double, long doubleC
    float, doubleC#
    floatMaple, OCaml, PHP, SML, Vimscript, YAML
    FloatRuby
    float, float32F#
    Float, Float32, Float64Pliant
    NUMERIC, DECIMAL, DOUBLE PRECISIONSQL92
    RatPerl6
    DOUBLE, REALEiffel
    single, doubleMatlab
    Float, Double, RatioHaskell
    Float, Double, Fraction, FixedPointSmalltalk
    float, decimal.DecimalPython
    Real, RationalMathematica
    NumberIo
    type T is digits N range Low..High;Ada
    type T is delta S digits N range Low..High;(125)Ada
    float32, float64Go

  • numbers syntax

    integers

    1000Awk, B, BourneShell, C, C#, C++, CoffeeScript, E, Eiffel, F#, Forth, Go, Haskell, Io, Java, JavaScript, Logo, Maple, Mathematica, merd, OCaml, Oz, Pascal, Perl, Perl6, PHP, Pike, Pliant, Prolog, Python, Rebol, Ruby, Scheme, Smalltalk, SQL92, Tcl, Yorick
    1000, 1000.Common Lisp, Emacs Lisp
    1000, 1000., 1000.0Awk, Matlab
    1000, '1000'DClassic REXX
    1000, 1E3Ada

    integers in base 2, octal and hexadecimal

    0b1, 07, 0xf(126)CoffeeScript, Oz, Perl, PHP5, Pike, Ruby
    0b1, 0o7, 0xfF#, OCaml, Perl6
    07, 0xfAwk, C, C++, JavaScript, Python, Tcl
    0xfC#, E, Go, Io, Yorick
    07B
    0o7, 0xfHaskell
    1bEiffel
    2#1#, 8#7#, 16#f#Ada
    2#{1}, #{F}Rebol
    #b1, #o7, #xfCommon Lisp, Emacs Lisp, Scheme
    2^^1, 8^^7, 16^^fMathematica
    2r1, 8r7, 16rfSmalltalk
    #2r1, #8r7, #16rfCommon Lisp, Emacs Lisp
    1b, FhPliant
    '1'B, 'F'XClassic REXX
    B'1', X'F'SQL92
    $fForth

    integer thousand-separator

    1_000, 10_00, 100_0Ada, E, Eiffel, OCaml, Perl, Perl6, Ruby
    1'000, 10'00, 100'0Rebol
    1_000merd

    floating point

    1000., 1E3C, C++, Classic REXX, CoffeeScript, E, F#, Go, Java, JavaScript, Logo, Maple, OCaml, Python, Scheme, SQL92, Tcl
    1000., 1E3, 1,0Rebol
    1000., 1.E3Eiffel, Oz
    1000.0, 1E3C#, Common Lisp, Emacs Lisp, PHP, Pike, Prolog, Ruby, Smalltalk
    1000.0, 1.0E3Ada, Haskell
    1000, 1000.0, 1E3(127)Awk, merd, Perl, Perl6
    1000., 1*^3, 1000`Mathematica
    1000e, 1e3Forth

  • addition / subtraction / multiplication / division

    + / - / * / /BourneShell, C, C#, C++, Classic REXX, CoffeeScript, Common Lisp, D, Eiffel, Emacs Lisp, F#, Forth, Go, Haskell, Io, Java, JavaScript, Logo, Maple, Matlab, merd, MUMPS, Perl, Perl6, PHP, Pliant, Prolog, Python, Ruby, Scheme, Smalltalk, SQL92, Tcl, Vimscript, Yorick
    + / - / * or nothing / /Mathematica
    + +. / - -. / * *. / / /.(128)OCaml
    sum / difference / product / quotientLogo
    add / sub / mul / idiv divPostScript
    f+ / f- / f* / f/Forth

  • exponentiation (power)

    **Ada, Classic REXX, E, F#, Fortran, Io, merd, OCaml, Perl, Perl6, PL/I, Prolog, Python, Rebol, Ruby, Tcl8.5
    ^Awk, Dylan, Eiffel, Lua, Mathematica, Matlab, Pliant, Yorick
    *(129)APL
    **, ^Maple
    ^^D
    **, ^ and ^^(130)Haskell
    f**Forth
    powC, C++, CoffeeScript, Java, JavaScript, PHP, Pike, Python, SML, Tcl
    PowC#, Oz
    powerDelphi-Kylix, Logo, Rebol
    expPostScript
    exptCommon Lisp, Emacs Lisp, Scheme
    raisedToSmalltalk
    math.PowGo

  • negation

    -Ada, Awk, B, BCPL, BourneShell, C, C#, C++, Classic REXX, CoffeeScript, Common Lisp, D, E, Eiffel, Emacs Lisp, F#, Go, Haskell, Io, Java, JavaScript, Logo, Maple, Mathematica, Matlab, merd, MUMPS, Perl, Perl6, PHP, Pike, Pliant, Prolog, Python, Rebol, Ruby, Scheme, Smalltalk, Tcl, Vimscript, Yorick
    - -.OCaml
    ~Oz, SML
    negPostScript
    negateForth, Rebol
    fnegateForth
    minusLogo

  • random

    random number

    randC, Maple, Matlab, Perl, Perl6, PHP, Ruby, Tcl
    randomCommon Lisp, Logo, Prolog, Python, Yorick
    $RANDOMMUMPS
    randomRHaskell
    Random(131)Ada
    Random.intOCaml
    Random, RandomReal, RandomIntegerMathematica
    Random valueIo
    Random new nextIntegerSmalltalk
    r: RANDOM
    create r.make
    r.start
    r.item
    Eiffel
    Random ran = new Random();
    ran.Next(...);
    C#
    let r = System.Random()
    r.Next()
    F#
    mt_randPHP
    rand.Read(132)Go

    seed the pseudo random generator

    srandC, Perl, Perl6, PHP, Ruby, Tcl
    set_seedEiffel
    random.seedPython
    Random setSeedIo
    Random.init, Random.self_initOCaml
    rand('state',...)Matlab
    rerandomLogo
    RandomTools[MersenneTwister][SetState]Maple
    Random new setSeedSmalltalk
    SeedRandomMathematica
    mkStdGenHaskell
    make-random-stateCommon Lisp
    ResetAda
    rand.Seed(133)Go

  • operator priorities and associativities

    addition vs multiplication

    mathematicalBourneShell, C, C#, C++, Classic REXX, Eiffel, F#, Go, Haskell, Io, Java, Maple, Mathematica, Matlab, merd, Perl, Perl6, PHP, Python, Ruby, Tcl, Yorick
    same prioritiesMUMPS, Smalltalk

    exponentiation vs negation (is -3^2 equal to 9 or -9)

    mathematicalClassic REXX, Eiffel, Haskell, Io, Maple, Mathematica, Matlab, Perl, Perl6, Python, Ruby
    negation firstF#, OCaml

  • square root / e-exponential / absolute value

    sqrt / exp / absAda, C, C++, CoffeeScript, Common Lisp, E, Eiffel, Emacs Lisp, F#, Haskell, Io, Java, JavaScript, Lua, Maple, OCaml, Pascal, Perl, Perl6, PHP, Prolog, Python, Ruby, Scheme, Smalltalk, SML, Tcl, Yorick
    sqrt realsqrt / exp / absMatlab
    sqrt / exp /Awk, Logo
    Sqrt / Exp / AbsC#, Mathematica, Oz
    sqrt / / absPostScript
    Sqrt / / ABSModula-3
    / exp / absPliant
    sqrt / /Pike
    square-root / exp / abs or absoluteRebol
    Sqrt / Exp / ABSClassic REXX
    sqrt,isqrt / exp / absTcl8.5
    fsqrt / fexp / abs,fabsForth
    math.SqrtGo

  • trigonometry

    basic

    sin / cos / tanAda, C, C++, CoffeeScript, Common Lisp, E, Emacs Lisp, F#, Haskell, Io, Java, JavaScript, Lua, Maple, Matlab, OCaml, Pascal, Perl, Perl6, PHP, Pike, Pliant, Prolog, Python, Ruby, Scheme, Smalltalk, SML, Tcl, Yorick
    Sin / Cos / TanC#, Classic REXX, Mathematica, Oz
    sin / cos /Awk, PostScript
    sine / cosine / tangentEiffel, Rebol
    radsin / radcos / radtanLogo
    fsin / fcos / ftanForth
    math.Sin / math.Cos / math.TanGo

    inverse

    asin / acos / atan(134)Ada, C, C++, CoffeeScript, Common Lisp, F#, Haskell, Io, JavaScript, Matlab, OCaml, Perl, Perl6, Pike, Pliant, Prolog, Python, Ruby, Scheme, Tcl, Yorick
    Asin / Acos / AtanC#, Oz
    ASin / ACos / ATanClassic REXX
    arcsin / arccos / arctanMaple
    arcSin / arcCos / arcTanSmalltalk
    ArcSin / ArcCos / ArcTanMathematica
    arcsine / arccosine / arctangentRebol
    arc_sine / arc_cosine / arc_tangentEiffel
    / / atanPostScript
    / / radarctanLogo
    fasin / facos / fatanForth
    math.Asin / math.Acos / math.AtanGo

  • logarithm

    base e

    lnDelphi-Kylix, Logo, Maple, Pascal, PostScript, Smalltalk, SML
    logAwk, C, C++, CoffeeScript, Common Lisp, E, Eiffel, Emacs Lisp, F#, Io, Java, JavaScript, Lua, Maple, Matlab, OCaml, Perl, Perl6, PHP, Pike, Pliant, Prolog, Python, Ruby, Scheme, Tcl, Yorick
    LogAda, C#, Classic REXX, Mathematica, Oz
    log 10Haskell
    log-eRebol
    flnForth
    math.LogGo

    base 10

    log10C, C++, Delphi-Kylix, Eiffel, F#, Io, Logo, Lua, Matlab, OCaml, Perl, Perl6, PHP, Pliant, Prolog, Python, Ruby, Tcl, Yorick
    Log10C#, Classic REXX
    logPostScript, SML
    log: 10Smalltalk
    log-10Rebol
    log[10]Maple
    Log[10, val]Mathematica
    logBase 10Haskell
    Log(X => val, Base => 10.0)Ada
    (log x 10)Common Lisp
    flogForth
    math.Log10Go

    base 2

    log2Matlab
    log-10 / log-2Rebol
    Log(X => val, Base => 2.0)Ada
    log(val, 2)Python
    Log[2, val]Mathematica
    frexpC
    math.Log2Go

  • euclidean division (both quotient and modulo)

    divmodPython, Ruby
    divModHaskell
    div ldiv lldivC
    IntInf.quotremSML
    floorCommon Lisp, Dylan
    /modForth
    Div(135)Go

  • modulo

    modulo of -3 / 2 is 1

    %Classic REXX, Perl, Perl6, Pike, Python, Ruby, Tcl
    %%E
    \\Smalltalk
    modAda, Common Lisp, Emacs Lisp, Haskell, Matlab, Prolog, SML
    ModMathematica
    MODModula-3
    moduloDylan, Logo, Ruby
    remProlog

    modulo of -3 / 2 is -1

    %Awk, B, C, C#, C++, CoffeeScript, E, F#, Go, Io, Java, JavaScript, PHP, Pliant, Yorick
    #MUMPS
    modF#, Forth, Lua, OCaml, Oz, Pascal, PostScript, Prolog, XPath
    remainderLogo, Ruby, Scheme
    remAda, BCPL, Haskell, Matlab, Smalltalk
    //Classic REXX, Rebol
    \\Eiffel

  • truncate / round / floor / ceil

    trunc / round / floor / ceilC, C++, Maple, Matlab
    truncate / round / floor / ceilingCommon Lisp, Haskell, Perl6, PostScript, Prolog, Scheme
    int / round / floor / ceilCoffeeScript, JavaScript, Pike, Python
    int / round / /Logo
    to_i, Integer() / round / floor / ceilRuby
    TRUNC / FORMAT / Floor / CeilClassic REXX
    Float'Truncation / Float'Rounding / Float'Floor / Float'Ceiling(136)Ada
    / round / floor / ceilE, Io, Java, Lua, PHP, SML, Tcl
    / Round / Floor / CeilingC#
    / Round / Floor / CeilOz
    / round / floor / ceilingDylan, Emacs Lisp, PostScript, XPath
    / ROUND / FLOOR / CEILINGModula-3
    / rounded / floor / ceilingEiffel, Smalltalk
    int / / floor / ceilF#, Perl
    int_of_float / / floor / ceilF#, OCaml
    / / floor / ceilLua, Yorick
    IntegerPart / Round / Floor / CeilingMathematica
    / Rounding / Floor / CeilingAda
    to-integer / / /Rebol
    / fround / /Forth
    math.Trunc / / math.Floor / math.CeilGo

  • bitwise operators

    and / or / xor

    & / | / ^C, C#, C++, CoffeeScript, E, Eiffel, Go, Java, JavaScript, Perl, PHP, Pike, Python, Ruby, Tcl
    & / | / ~Yorick
    & / |YCP
    +& / +| / +^Perl6
    .&. / .|. / xor(137)Haskell
    &&& / ||| / ^^^F#
    and / or / xorAda, Forth, PostScript, Rebol
    land / lor / lxorF#, OCaml
    logand / logior / logxor(138)Common Lisp
    bitand / bitor / bitxorLogo, Matlab
    BITAND / BITOR / BITXORClassic REXX
    BitAnd / BitOr / BitXorMathematica
    bitAnd / bitOr / bitXorSmalltalk
    bitwiseAnd / bitwiseOr / bitwiseXorIo
    /\ / \/ / xorProlog

    bitwise inversion

    ~C, C#, C++, CoffeeScript, Java, JavaScript, Perl, PHP, Pike, Python, Ruby, SML, Tcl, YCP
    ~~~F#
    notAda, Eiffel, PostScript
    lnotF#, OCaml
    lognot(139)Common Lisp
    bitnotEiffel, Logo
    BitNotMathematica
    complementHaskell, Rebol
    bitcmpMatlab
    bitInvertSmalltalk
    bitwiseComplementIo
    invertForth
    \Prolog

    left shift / right shift / unsigned right shift

    << / >> / >>>CoffeeScript, Java, JavaScript
    << / >>C, C#, C++, Go, Perl, PHP, Pike, Prolog, Python, Ruby, Tcl, YCP
    <<< / >>>F#
    |<< / |>>Eiffel
    lsl / lsr or asrF#, OCaml
    bitshiftMatlab, PostScript
    bitShiftSmalltalk
    ashift lshiftLogo
    lshift / rshiftForth
    shiftL / / shiftRHaskell
    shiftLeft / shiftRightIo
    Shift_Left / Shift_Right / Shift_Right_Arithmetic / Rotate_Left / Rotate_RightAda
    (ash x positive-integer) / (ash x negative-integer) /Common Lisp


Threads

  • thread definition

    class class_name(threading.Thread) {[override run method] }Python
    task task_name is [entry entry_name[(parameter ...)]...] end task_nameAda
    task type task_type_name is [entry entry_name[(parameter ...)]...] end task_type_nameAda
    class class_name extends Thread {[override run method] }Java
    thread ...Pliant
    parallel [threads nb_threads] [mini mini_threshold] [maxi maxi_threshold] [active]
       ...
       task
         parallel_instructions
       [post
         sequential_instructions]
       ...
    Pliant
    [NSThread detachNewThreadSelector:mainFunction toTarget:target withObject:obj]Objective-C

  • thread creation

    object t=Thread.Thread(f)Pike
    set t [thread create {code}]Tcl
    Thread createThread(...)Io

  • thread object creation

    MyTask : task_type_name;Ada
    class_name MyThread = new class_name()Java
    p := [ ... ] newProcess.Smalltalk
    p := [ ... ] fork.(140)Smalltalk

  • starting / stopping threads

    start() / stop()(141)Java
    resume / suspend / terminateSmalltalk
    Tasks are started when created / call Stop entry or "abort task-object-name"Ada
    thread send $t {script}Tcl

  • passing data directly between threads

    call an entry with parametersAda
    call any public methodJava
    common variables are copied at thread creation, in abscence of a "share" statementPliant
    use messages, parameters or shared variables(142)Smalltalk

  • terminating thread communication due to a time-out

    select task_entry_call; or delay timeout_limit; end select;Ada

  • Thread Synchronization

    Defining a Synchronized Shared Resource

    thread::mutexTcl
    protected Object_Name is [entry entry_name(Parameter : [in out] is type [...]);
    procedure procedure_name(Parameter : [in out] is type [...]);
    function function_name return type;
    private
    shared data declaration
    end Object_Name;
    Ada
    synchronize (this){ ... }Java
    SharedQueue, Semaphore critical: [...], Future, LazyValueSmalltalk

    Synchronized Writing to a shared resource

    Object_Name.Entry_Name(Parms)
    Object_Name.Procedure_Name(Parms)
    Ada
    Object_Name.SetMethod(Parms)Java

    Synchronized Reading of a Shared Resource

    Object_Name.Function_NameAda
    Object_Name.GetMethod()Java

    Monitor Syntax

    Objectg_Name.Entry_Name(Parms)Ada

  • Joining Another Thread

    Suspending a thread until another thread completes

    Call task entry serviced just before task terminationAda
    OtherThread.join()Java, Python

    Suspending a Thread Until Another Thread Establishes An Internal State

    Call a task entry on the other threadAda

  • Thread Prioritization

    Selecting a Prioritization Model

    pragma Locking_Policy(Ceiling_Locking);Ada

    Establishing a base thread priority

    pragma Priority(expression);Ada

    Changing Thead Priority

    Set_Priority(Priority_Value);Ada
    setPriority(newPriority);Java
    p priority: nSmalltalk

  • Thread-safe sharing of data without synchronization

    Ensuring access is atomic

    pragma Atomic(Object_Name);Ada

    Ensuring access is always via a local copy of the shared data

    pragma Volatile(Object_Name);Ada


Remarks

  • (1) introduced in Scheme in R6RS
  • (2) when unused
  • (3) for C, it is not a standard convention, but it is the more widespread
  • (4) any string literal would work
  • (5) see also =head1, =head2, =over, etc
  • (6) need "file: %script-header.r" in file header
  • (7) for user defined functions only
  • (8) displayed <- with a special character
  • (9) variable on the right
  • (10) F#: with indentation
  • (11) the variable behaves like a pointer
  • (12) cf horizontal layout
  • (13) introduce scope
  • (14) Smalltalk: introduce scope
  • (15) ascii representation, original uses a special charset
  • (16) in Modula-2, <> and # are synonyms
  • (17) === and !== differ from == and != when the objects' type differ
  • (18) for objects
  • (19) normal / structural / unification / arithmetic
  • (20) structural / mathematical
  • (21) deep comparison
  • (22) in List::Util
  • (23) just 'eval' evaluates JavaScript
  • (24) Univ operator
  • (25) starting with PHP 5.3
  • (26) procedure call
  • (27) in Pliant, special sugar for only one parameter
  • (28) only for one parameter
  • (29) only for two parameters
  • (30) f is a block
  • (31) Python >= 2.5
  • (32) it does not scale to 3rd argument
  • (33) lambda (x . y) ...
  • (34) only final parameter may be variadic and accepts zero or more arguments
  • (35) when callee has special "&" prototype
  • (36) this is a block, not precisely a function, but it's alike
  • (37) manual declaration of local variables wanted in the closure
  • (38) see also: #1 + #2 &
  • (39) also works for procedures: proc {$ A B} ... end
  • (40) x, y, z are the parameters
  • (41) method is optional
  • (42) in Lua, "return xxx" can only appear before a block end. in Matlab, only in inline('...')
  • (43) "return" is used when there is no value to return
  • (44) in Matlab, only for anonymous function
  • (45) firefox
  • (46) C#4, only for "dynamic" objects
  • (47) the result goes to "e"
  • (48) "break"s are mandatory, even for "default"!
  • (49) Perl >= 5.8.0
  • (50) 1 is optional in this example, since min is 1 by default
  • (51) in Ruby, see also catch/throw
  • (52) often provided in the abbreviated form call/cc
  • (53) matches an expression of type t
  • (54) type is infered
  • (55) expression "e" is cast to the type of "v"
  • (56) for parameters
  • (57) quite bad: only the reference is non-mutable whereas the object is still mutable
  • (58) eventual send
  • (59) properties are something alike attributes, but really are methods
  • (60) one level depth
  • (61) general deep copy function
  • (62) object cloning is the default, uses the copy constructor in C++
  • (63) or simply o_ := o for non-polymorphic objects
  • (64) c'Class is the class rooted in c
  • (65) see also isMemberOf
  • (66) assignment attempt
  • (67) see also callable(obj.meth) for unbound methods
  • (68) in Python, usually called self
  • (69) ":" is for external symbols only, recommended
  • (70) directory name is package name
  • (71) if names are exported using @EXPORT
  • (72) if names are not exported or are exported using @EXPORT_OK
  • (73) deprecated in ANSI Common Lisp, but used in ASDF
  • (74) using a correspondance from the package name to the file name
  • (75) inside a function
  • (76) since PHP 5.3
  • (77) no spaces
  • (78) when using format
  • (79) need expandMacros
  • (80) where T is the type of the value
  • (81) see also cPickle
  • (82) but not using the C-like %-syntax
  • (83) adding an end-of-line
  • (84) in BourneShell, adding an end-of-line
  • (85) adding an end-of-line unless already newline-terminated
  • (86) Always case insensitive
  • (87) Always case sensitive
  • (88) faster than isEqual
  • (89) the string is represented on the stack as (addr len)
  • (90) in Lua >= 5.0
  • (91) in C++, is range-checked whereas a[i] is not
  • (92) ESI dialect
  • (93) beware of 0.0 which is true in Pike!
  • (94) Smalltalk: postfix operator
  • (95) in Modula-2, "&" and "and" are synonyms
  • (96) in Oz, simple functions, not operators
  • (97) new in PHP 5.4
  • (98) restricted to initialisation of a local variable in C and C++
  • (99) a b c must be constants
  • (100) beware, if you give only one integer argument, it is the size!
  • (101) for write access: a i o put
  • (102) in C++, it is range-checked whereas a[i] is not. in Smalltalk, for write access: a :at i :put o
  • (103) see also Head
  • (104) list comprehension
  • (105) not in standard
  • (106) in C++, it is done in place
  • (107) in Scheme, not standard, but nearly standard
  • (108) the result is not guaranteed to be the same as the order in the input
  • (109) in Perl, in List::Util
  • (110) Borland extension in Pascal
  • (111) prefix
  • (112) postfix
  • (113) infix
  • (114) optional value is only for pointers
  • (115) only for "access" types in Ada
  • (116) introduced in Perl 5.10
  • (117) attribute selector
  • (118) Java: introduced in 1.5
  • (119) n1, n2, ...
  • (120) returns an iterator
  • (121) right-bias
  • (122) left-bias
  • (123) jot on BSD
  • (124) long is a big integer
  • (125) fixed point
  • (126) 0b1 new in PHP 5.4
  • (127) integers are decimals
  • (128) with mathematical priorities
  • (129) APL uses a real multiplication sign for multiplication from a special character set
  • (130) for each various types
  • (131) from instances of Ada.Numerics.Float_Random or Ada.Numerics.Discrete_Random
  • (132) "math/rand" is pseudo random whereas "crypto/rand" is cryptographically random
  • (133) only applies to "math/rand"
  • (134) Ruby >= 1.7
  • (135) method on big.Int
  • (136) replace Float with whatever type you are using
  • (137) in module Data.Bits
  • (138) see also bit-and / bit-or / bit-xor
  • (139) see also bit-not
  • (140) equivalent to newProcess + resume
  • (141) "stop" is now deprecated
  • (142) a thread is created from a block, which is a closure on the variables as seen by the block

Similar Pages

  • Belorussian translation of this page
  • Comparison of programming languages syntax
  • Comments and Literals in programming languages
  • The Surface of Programming Languages
  • Delphi, VisualBasic, C++, Java
  • SML, OCaml
  • Java, C++, Smalltalk
  • Java, C#
  • Java, C#
  • Ruby, Java, Perl
  • Python, Perl
  • Python, Lisp
  • PL/I, C
  • Perl, PHP
  • EmacsLisp, Perl
  • Smalltalk, Lisp
  • Tasks in many languages

References

  • BCPL
  • Eiffel
  • SQL

Credits

  • Yoann 'Pad' Padioleau (Haskell additions, Beta, various fixes)
  • Jakub Travnik (Pascal, Delphi-Kylix)
  • Robert Feldt (Ruby additions)
  • Pascal Terjan (PHP)
  • Carlos 'angus' (PostScript)
  • Axel Kittenberger (various)
  • Guido van Rossum (block vs scoping)
  • Jeffrey Hobbs (Tcl)
  • Mark-Jason Dominus (SML, various)
  • Ash Searle (Java, PHP, JavaScript)
  • Mark S. Miller (E)
  • Pete Jinks (various)
  • Steve Tolkin (various)
  • Franck Arnaud (Eiffel)
  • Tom Murphy (SML)
  • Guy Steele (Fortran, and many various)
  • Carl Gay (Dylan, CommonLisp)
  • Jay [email protected] (Lua)
  • Philippe Lhoste (Lua, JavaScript)
  • Jim Rogers (Ada, Java, Threads section)
  • Ketil Z. Malde (Haskell)
  • Mark Carroll (Modula-3)
  • Keith Wansbrough (Haskell and a few SML)
  • Remi Vanicat (OCaml)
  • Matthieu Villeneuve (CommonLisp)
  • Joachim Durchholz (Eiffel)
  • Walter Vannini (C, "breaking lines" idea)
  • Peter Lewerin (Tcl)
  • Patrice Ossona de Mendez (Pliant)
  • Bert Freudenberg (Smalltalk & Squeak additions corrections)
  • Dennis Haney (Perl, C#)
  • Fergus Henderson (Mercury)
  • Ralph Becket (Mercury)
  • Bill Thornton (Java)
  • Nik Crabtree (C#)
  • Neal Holtz (Python)
  • Donald Chai (Python)
  • Fred Spiessens (Oz)
  • Martin Nilsson (Pike)
  • Theodore Eastman (VisualBasic)
  • George Herson (Eiffel)
  • Lee Denison (Tcl)
  • Anton Rolls (Rebol)
  • Pedro (Lua)
  • Nathan Sharfi (C99, C#, C++)
  • Dirk Gerrits (Common Lisp, Scheme, Emacs Lisp)
  • Tabitha Arrowny (Ruby, Python, Perl, ...)
  • Péter Varga (BourneShell, Common Lisp, ...)
  • Ian Henderson (Objective C)
  • Anthony Borla (Classic REXX, Prolog, Logo)
  • Paul McJones (Modula-3 fixes)
  • Uwe Kolb (Smalltalk fixes)
  • Ciaran McNulty (PHP)
  • David B. Nagle (Yorick)
  • Michael Schaufelberger (Eiffel)
  • Samuel Charron (Erlang)
  • Kyle Ross (OCaml)
  • Damien Krotkine (Ruby)
  • Guillaume Cottenceau (Java)
  • David.Whitten (MUMPS)
  • Phil Howard (various)
  • Andrzej Zawadzki (Ruby)
  • Stuart Brady (VisualBasic)
  • Joris Gillis (Maple)
  • Garrett Wollman (Ruby, BourneShell, C...)
  • Claus Gittinger (Smalltalk)
  • Bobby 'nneonneo' Xiao (Python)
  • Michael Schlenker (Tcl)
  • Alex Vondrak (Python)
  • Daniel Laberge (Pascal)
  • Daniel Wagner (Haskell)
  • Bob Bane (Common Lisp)
  • Alan Hogan (Java)
  • Steve Davison (C)
  • Konstantin Yegupov (PHP, Python...)
  • Noé Rubinstein (Io, CoffeeScript)
  • Florentin Millour (Yorick)
  • Axel Liljencrantz (FishShell)
  • Sanghyeon Seo (Lua)
  • Szabolcs Horvát (Mathematica)
  • Laurent Le Brun (F#, GNU-sed)
  • Julien Hall (Smalltalk)
  • Ian Osgood (Forth)
  • Dmitry A. Kazakov (Ada)
  • Peter Hermann (Ada)
  • Ian Jackson (Tcl, Perl, C, Assembler...)
  • Steve Breese
  • Nils M Holm (Scheme, ...)
  • Stas Malyshev (PHP5)
  • Adam Woodbeck (Go)

Pixel
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.0 Generic License.
Generated from syntax-across-languages.html.pl
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.