Sunteți pe pagina 1din 112

9/16/2016

syntax across languages (One Big Page)

Introduction

What's this about?

Language Designers:languages (One Big Page) Introduction What's this about? Looking for operator or function names? Well have

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

Language Users:and remember using existing one may ease the transition :) You know one language and want

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

Language lovers:the corresponding operator or function in another language Want to know the various ways people invented

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 commentingSame content split into multiple html files Categories documentation comment information about the current line

into multiple html files Categories Various commenting documentation comment information about the current line
documentation comment information about the current line and file tokens breaking lines (useful when end­of­line
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 functionmanual memory allocation force garbage collection

caller information function composition identity function
caller information function composition identity function
caller information function composition identity function
caller information function composition identity function
caller information function composition identity function
caller information function composition identity function
caller information function composition identity function
caller information function composition identity function
caller information function composition identity function

9/16/2016

syntax across languages (One Big Page)

Control Flow sequence9/16/2016 syntax across languages (One Big Page) if_then if_then_else ifnot_then (unless) multiple selection (switch)

syntax across languages (One Big Page) Control Flow sequence if_then if_then_else ifnot_then (unless) multiple selection
if_then if_then_else ifnot_then (unless) multiple selection (switch) loop breaking control flow exception
if_then if_then_else ifnot_then (unless) multiple selection (switch) loop breaking control flow exception
if_then if_then_else ifnot_then (unless) multiple selection (switch) loop breaking control flow exception
if_then if_then_else ifnot_then (unless) multiple selection (switch) loop breaking control flow exception
if_then if_then_else ifnot_then (unless) multiple selection (switch) loop breaking control flow exception
if_then if_then_else ifnot_then (unless) multiple selection (switch) loop breaking control flow exception
if_then if_then_else ifnot_then (unless) multiple selection (switch) loop breaking control flow exception

if_then if_then_else ifnot_then (unless) multiple selection (switch) loop breaking control flow exception call­with­current­continuation

ifnot_then (unless) multiple selection (switch) loop breaking control flow exception call­with­current­continuation
ifnot_then (unless) multiple selection (switch) loop breaking control flow exception call­with­current­continuation
ifnot_then (unless) multiple selection (switch) loop breaking control flow exception call­with­current­continuation
ifnot_then (unless) multiple selection (switch) loop breaking control flow exception call­with­current­continuation
ifnot_then (unless) multiple selection (switch) loop breaking control flow exception call­with­current­continuation
ifnot_then (unless) multiple selection (switch) loop breaking control flow exception call­with­current­continuation

Typescontrol flow exception call­with­current­continuation declaration annotation (or variable declaration) cast

declaration annotation (or variable declaration) cast mutability, constness
declaration annotation (or variable declaration) cast mutability, constness
declaration annotation (or variable declaration) cast mutability, constness
declaration annotation (or variable declaration) cast mutability, constness

declaration annotation (or variable declaration) cast mutability, constness

declaration annotation (or variable declaration) cast mutability, constness
declaration annotation (or variable declaration) cast mutability, constness
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(or variable declaration) cast mutability, constness Package, Module package scope declare import Strings type

Package, Module package scope declare importinstance accessing parent method accessing child method Strings type name character type name character "z"

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 substringchild method Package, Module package scope declare import

to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring
to ascii accessing n­th character extract a substring

9/16/2016

syntax across languages (One Big Page)

locate a substring9/16/2016 syntax across languages (One Big Page) locate a substring (starting at the end) Booleans type

locate a substring (starting at the end)syntax across languages (One Big Page) locate a substring Booleans type name false value true value

Booleanslocate a substring locate a substring (starting at the end) type name false value true value

type namesubstring locate a substring (starting at the end) Booleans false value true value logical not logical

false valuelocate a substring (starting at the end) Booleans type name true value logical not logical or

true value(starting at the end) Booleans type name false value logical not logical or / and Bags

logical notat the end) Booleans type name false value true value logical or / and Bags and

logical or / andend) Booleans type name false value true value logical not Bags and Lists type name list

Bags and Listsname false value true value logical not logical or / and type name list concatenation list

type namevalue true value logical not logical or / and Bags and Lists list concatenation list flattening

list concatenationvalue logical not logical or / and Bags and Lists type name list flattening list constructor

list flatteninglogical or / and Bags and Lists type name list concatenation list constructor list/array indexing adding

list constructorBags and Lists type name list concatenation list flattening list/array indexing adding an element at the

list/array indexingname list concatenation list flattening list constructor adding an element at the beginning (list cons) adding

adding an element at the beginning (list cons)list flattening list constructor list/array indexing adding an element at index adding an element at the

adding an element at indexindexing adding an element at the beginning (list cons) adding an element at the end first

adding an element at the endat the beginning (list cons) adding an element at index first element all but the first

first elementadding an element at index adding an element at the end all but the first element

all but the first elementelement at index adding an element at the end first element last element all but the

last elementelement at the end first element all but the first element all but the last element

all but the last elementthe end first element all but the first element last element get the first element and

get the first element and remove itbut the first element last element all but the last element get the last element and

get the last element and remove itall but the last element get the first element and remove it for each element do

for each element do somethingelement and remove it get the last element and remove it transform a list (or bag)

transform a list (or bag) in another onethe last element and remove it for each element do something transform two lists in parallel

transform two lists in paralleldo something transform a list (or bag) in another one find an element keep elements partition

find an elementlist (or bag) in another one transform two lists in parallel keep elements partition a list:

keep elementsanother one transform two lists in parallel find an element partition a list: elements matching, elements

partition a list: elements matching, elements non matchingtwo lists in parallel find an element keep elements split a list is an element in

split a listpartition a list: elements matching, elements non matching is an element in the list is the

is an element in the listlist: elements matching, elements non matching split a list is the predicate true for an element

is the predicate true for an elementelements non matching split a list is an element in the list is the predicate true

is the predicate true for every elementan element in the list is the predicate true for an element smallest / biggest element

smallest / biggest elementtrue for an element is the predicate true for every element join a list of strings

join a list of strings in a string using a glue stringpredicate true for every element smallest / biggest element list size iterate with index remove duplicates

list sizejoin a list of strings in a string using a glue string iterate with index remove

iterate with indexa list of strings in a string using a glue string list size remove duplicates sort

remove duplicatesin a string using a glue string list size iterate with index sort reverse list of

sorta glue string list size iterate with index remove duplicates reverse list of couples from 2

reversestring list size iterate with index remove duplicates sort list of couples from 2 lists 2

list of couples from 2 listslist size iterate with index remove duplicates sort reverse 2 lists from a list of couples

2 lists from a list of couplesremove duplicates sort reverse list of couples from 2 lists lookup an element in a association

lookup an element in a association listlist of couples from 2 lists 2 lists from a list of couples list out of

list out of a baga list of couples lookup an element in a association list f( f(f(init, e1), e2)  

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

 

en)

,

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

f(en, init)

 

))

Various Data Types  en) , f(e1, f(e2, f(en, init)   )) tuple type tuple constructor computable tuple (these

tuple typef(e1, f(e2, f(en, init)   )) Various Data Types tuple constructor computable tuple (these are a

tuple constructorf(en, init)   )) Various Data Types tuple type computable tuple (these are a kind of

computable tuple (these are a kind of immutable lists playing a special role in parameter passing)  )) Various Data Types tuple type tuple constructor reference (pointer) optional value record union type

reference (pointer)immutable lists playing a special role in parameter passing) optional value record union type declaration

optional valuea special role in parameter passing) reference (pointer) record union type declaration

recordin parameter passing) reference (pointer) optional value union type declaration

union type declarationparameter passing) reference (pointer) optional value record

9/16/2016

syntax across languages (One Big Page)

enumerated type declaration

enumerated type declaration

dictionary

dictionary

range

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 euclidian division (both quotient and modulo) modulo truncate / round / floor / ceil bitwise operatorsPage) enumerated type declaration dictionary range Threads thread definition thread creation thread object

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 synchronizationmodulo truncate / round / floor / ceil bitwise operators Various commenting until end of line

Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,
Thread­safe sharing of data without synchronization Various commenting until end of line # Awk, BourneShell,

Various

commentingThread­safe sharing of data without synchronization Various until end of line # Awk, BourneShell, CoffeeScript, E,

until end of line

#

Awk, BourneShell, CoffeeScript, E, FishShell, GNU­bc, GNU­sed, Icon, Io, Maple, merd, Perl, Perl6, PHP, Pliant, Python, Ruby, Tcl, YAML

//

BCPL, C#, C++, C99, Dylan, F#, 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

rem

Basic

'

Visual Basic

\

Forth

!

Assembler, Fortran90

NB.

J

9/16/2016

syntax across languages (One Big Page)

C

or * in

Fortran

column 1

nestable

(*

*)

Beta, F#, Mathematica, Modula­3, OCaml, Pascal, SML

%(

%)

Matlab

/*

*/

Classic REXX, Dylan, Io, Oz, SQL99

{

}

Pascal, Rebol

{‐

‐}

Haskell

#|

|#(1)

Common Lisp, Scheme

#[

]

Perl6

#if 0

#endif C

 

comment {

}

Rebol

comment [

]

Rebol

[

](2)

Rebol

‐‐[[

]]

Lua

non nestable

"

"

Smalltalk

/*

*/

B, C, C#, C++, CSS, GNU­bc, Java, JavaScript, Mercury, PHP, Pike, PL/I, YCP, Yorick

<!‐‐

‐‐> HTML, XML

(

)

Forth

###

 

CoffeeScript

###

( ) Forth ###   CoffeeScript ### documentation comment until end of line /// C#, F#,

documentation comment

until end of line

/// C#, F#, Java

‐‐ | Haskell

‐‐ ^ Haskell

non nestable

/**

*/(3) C, C#, E, Java, PHP

 

(**

*)

F#

{‐|

‐}

Haskell

(**

*)

OCaml

/* DOCUMENT

*/

Yorick

9/16/2016

syntax across languages (One Big Page)

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

information about the current line and filelines are displayed when getting help for MYFUNCTION % LINE FILE C, C++, Perl, PHP, Pike,

LINE

FILE

C, C++, Perl, PHP, Pike, Ruby

LINE

SOURCE_FILE

F#

$?LINE $?FILE

Perl6

file

Python

(new System.Diagnostics.StackFrame(true)).GetFileLineNumber() (new System.Diagnostics.StackFrame(true)).GetFileName()

C#

Thread.currentThread().getStackTrace()[1].getLineNumber();

Java

Thread.currentThread().getStackTrace()[1].getFileName();

system/script/header/file(6)

Rebol

SOURCELINE() / parse source OS . SOURCENAME

Classic REXX

info frame 0

Tcl8.5

thisContext lineNumber / thisContext method source

Smalltalk

tokens/ thisContext method source S m a l l t a l k

9/16/2016

syntax across languages (One Big Page)

case­sensitivity (keywords, variable identifiers )

case‐sensitive

Awk, B, BourneShell, C, C#, C++, CoffeeScript, F#, FishShell, Haskell, Io, Java, JavaScript, Lua, Maple, Mathematica, Matlab, merd, Modula­3, OCaml, Perl, Perl6, Pike, Pliant, Prolog, Python, Ruby, Smalltalk, Tcl, XML, YAML, Yorick

caseinsensitive Ada, Assembler, Classic REXX, Common Lisp, CSS, Eiffel, Forth, HTML, Logo, Pascal, PL/I, Rebol, SGML, SQL92, Visual Basic

case‐sensitive:

 

variables

case‐insensitive:

keywords,

PHP

functions,

constants

case‐sensitive:

 

identifiers

case‐insensitive:

E

keywords

case‐sensitive:

 

identifiers

MUMPS

case‐insensitive:

commands

 

case‐sensitive:

upper case

GNU­bc

disallowed

what is the standard way for scrunching together multiple words

camelCase

CoffeeScript, JavaScript

CamelCase or camelCase

C#, E, Haskell, Io, Java, JavaScript, Mathematica, Pascal, Smalltalk, Tcl, Visual Basic

underscores

FishShell, GNU­bc, merd

dots

Logo

hyphens

Common Lisp, Emacs Lisp, Rebol, Scheme

underscores for functions / types, unclear for modules / constructors

OCaml

UPPER_CASE

BourneShell

lowercasenoseparator

Matlab

underscores, UPPER_CASE for class names

Eiffel

CamelCase for classes, underscores for methods

Python

CamelCase for types, underscores for functions, variables,

Pliant

CamelCase for methods, types and modules, underscore for functions

F#

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 variables

Pike

9/16/2016

syntax across languages (One Big Page)

CamelCase for modules, ALL_CAPS for constants, unclear for functions / variables

Perl, Perl6

CamelCase for variables, underscores for predicates

Prolog

usually lowercase or underscores, ALL_CAPS for macros

C

usually underscores

C++

Camel_Case

Ada

variable identifier regexp

[a‐zA‐Z][a‐zA‐Z0‐9]*

FishShell, Mathematica, PL/I, Smalltalk

[a‐zA‐Z][_a‐zA‐Z0‐9]*

Eiffel, Matlab

[a‐zA‐Z](_?[a‐zA‐Z0‐9])*

Ada

[_a‐zA‐Z][_a‐zA‐Z0‐9]*

Awk, B, C, C#, C++, E, 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 number

Common 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

[^ \t\n\r\f]+

Tcl

[^ \t\n\r\f/]+

FishShell

keyword regexp (if different from variable identifier regexp)

[A‐Z]+

[A‐Z]+

9/16/2016

syntax across languages (One Big Page)

Modula­3

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
[_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)l [_a‐z][_a‐zA‐Z0‐9']* M e r c u r y nothing Ada, B, C, C#, C++, Common

nothing

Ada, B, C, C#, C++, Common Lisp, Eiffel, Emacs Lisp, F#, Forth, Haskell, Java, JavaScript, Maple, Mathematica, OCaml, Oz, Pascal, Perl, Perl6, PHP, PostScript, Rebol, Scheme, Smalltalk, SML, XSLT, YCP

needed

\

Awk, BourneShell, C, CoffeeScript, E, FishShell, GNU­bc, Io, Python, Ruby, Tcl

 

Visual Basic

_

,

Classic REXX

~

Logo

 

Matlab

variable assignment or declaration_ , Classic REXX ~ Logo   Matlab assignment   Awk, B, Basic, BourneShell, C, C#,

assignment

 

Awk, B, Basic, BourneShell, C, C#, C++, Classic REXX, Erlang, 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

 

_(7) Squeak

:

BCPL, Rebol

‐>(8) Beta

def PostScript

setq Common Lisp, Emacs Lisp

setf Common Lisp

set Common Lisp, FishShell, Rebol

SET

v=

MUMPS

 

set! Scheme

is

Prolog

9/16/2016

syntax across languages (One Big Page)

make

"v

e Logo

e

v ! Forth

declaration

=

Haskell, Mercury, Prolog

<‐

Haskell

:‐

Prolog

:=

Io

let v = e in

 

F#, OCaml

let val v = e in

 

SML

let v = e(9)

 

BCPL, F#

def v := e / var v := e

 

E

my / our / local / use vars

 

Perl

my / our / temp

 

Perl6

define

 

Dylan, Scheme

let let*

 

Common Lisp, Scheme

letrec

 

Scheme

flet labels defun defmethod defvar defparameter defsetf

Common Lisp

local V1 = e V2 = e2 in

 

end

Oz

global v1, v2

 

Python

global v1 v2

 

Matlab, Scilab

:@

Beta

NEW v

 

MUMPS

v: t

 

Ada, Eiffel, Pascal

t

v

C, C#, C++, Java

|

v1 v2 |

Smalltalk

auto v1, v2; extrn v3, v4;

 

B

auto

 

GNU­bc

var

 

JavaScript, Pliant

gvar

 

Pliant

variable v(10)

 

Forth

e

value v

Forth

Module[{x, y = v},

]

Mathematica

Block[{x, y = v},

]

 

Mathematica

With[{c1 = v1, c2 = v2,

 

},

]

Mathematica

9/16/2016

syntax across languages (One Big Page)

<xsl:variable name="v" select="e"/>

XSLT

both

=

CoffeeScript, GNU­bc, merd, Python, Ruby

:=

merd

set, variable Tcl

grouping expressionsmerd, Python, Ruby := merd set, variable T c l ( ) Ada, Awk, B, BCPL,

(

)

Ada, Awk, B, BCPL, Beta, C, C#, C++, Classic REXX, CoffeeScript, E, Eiffel, F#, GNU­ bc, Haskell, Io, Java, JavaScript, 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, XPath, YCP, Yorick

[

]

Rebol

indentation merd

 

$

Haskell

begin

F#, FishShell, OCaml, Ruby

end

space(11)

merd

block (grouping statements, especially when statements are not expressions)FishShell, OCaml, Ruby end space (11) m e r d { } Awk, BCPL, BourneShell, GNU­bc,

{

}

Awk, BCPL, BourneShell, GNU­bc, GNU­sed, JavaScript, PHP, Pike, Tcl, Yorick

{

}(12)

B, C, C#, C++, E, Haskell, Java, Modula­3, Perl, Perl6, YCP

(

)(12)

BourneShell

[

](13)

Logo, Smalltalk

"

"

Tcl

begin

 

end(12)

Ada, Pascal

(begin

 

)

Scheme

BEGIN

 

END

Modula­3

do

end

Classic REXX

do

end(12)

Lua, PL/I

indentation

CoffeeScript, F#, MUMPS, Pliant, Python

indentation(12)

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

 

}

9/16/2016

syntax across languages (One Big Page)

foo

end foo where foo in { if, }

Ada, Fortran90

do,

(*

*)(14)

BCPL

(#

#)

Beta

use a block as a return value (when statements are not expressions)(* *) (14) B C P L (# #) B e t a valof B C

valof

BCPL

do

Perl, Perl6

proc()

end proc Maple

equality / inequalitydo Perl, Perl6 proc() end proc M a p l e shallow == != Awk, B,

shallow

== !=

Awk, B, C, C++, CoffeeScript, F#, Io, Java, OCaml, Perl, Perl6, Pike, Yorick

= /=

Eiffel, Fortran90

= <>

Forth, Logo, Maple, Modula­2, Pliant, Rebol

= #(15)

Modula­2, Modula­3

= !=

BourneShell, FishShell

== === != !==(16) JavaScript, PHP

=== !==

Perl6, PHP5

== ~=

Lua

== ~~

Smalltalk

== ~==

Dylan

= '=

MUMPS

= ~= neqv(14)

BCPL

f= f<>

Forth

is_equal(17)

Eiffel

eq ne

Emacs Lisp, PostScript

eq, eql

Common Lisp

eq? eqv?

Scheme

.EQ.

.NE.

Fortran

is / is not

Python

deep

== !=

Awk, C#, C++, E, merd, PHP5, Python, Ruby, Tcl, YCP

== <>

Python

== /=

Haskell

== \=

Oz

9/16/2016

syntax across languages (One Big Page)

== \==

Classic REXX, Prolog

= /=

Ada

= !=

Maple, XPath

= <>

Beta, F#, OCaml, Pascal, Rebol, SML, SQL92, Visual Basic

=

~=

Dylan, Smalltalk

== ~= eq ne isequal isequalwithequalnans

Matlab

== ~= eq ne isequal

Scilab

=@= \=@= / = \= / =:= =\=(18)

Prolog

=== =!= / == !=(19)

Mathematica

.eq

Logo

equal?

Scheme

equals

Java

 

equal

Common Lisp, Emacs Lisp, Pike

equalp

Common Lisp

eqv

Perl6

deep_is_equal

Eiffel

isEqual

Objective­C

E i f f e l isEqual Objective­C comparison   Ada, Awk, Awk, B, Beta, C,

comparison

 

Ada, Awk, Awk, B, Beta, C, C#, C++, Classic REXX, CoffeeScript, Common Lisp, Dylan, E,

<

> <=

Eiffel, Emacs Lisp, F#, Forth, 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, Visual Basic, XPath, YCP, Yorick

>=

<

> =<

>=

Mercury, Oz

<

> '>

'<

MUMPS

<< >>

<<= >>=

Classic REXX

(20)

@< / @=

<

/ @>

Prolog

/ @>=

lt gt

le ge Perl, Perl6, PostScript

‐lt ‐gt

le ge BourneShell, FishShell, MSH

.LT.

 

.GT.

Fortran

9/16/2016

syntax across languages (One Big Page)

.LE.

 

.GE.

u< u>

u<=

u>= Forth

f< f>

Forth

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

a <=> b

merd, Perl, Perl6, Ruby

cmp

Perl, Perl6, Python

compare

F#, Forth, Haskell, Mercury, OCaml, Pliant, Prolog, Smalltalk

strcmp

C, PHP

three_way_comparison Eiffel

string compare

Tcl

compareTo

Java

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

compare

Pliant

compareTo E

min / max (binary or more)

min / max

Beta, 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

Perl

maxstr(21)

Min / Max

Mathematica, Oz

MIN / MAX

Classic REXX, Modula­3

measure‐object ‐ min / measure‐ object ‐max

MSH

fmin / fmax

Forth

Integer'min /

Ada

Integer'max

o r t h Integer'min / Ada Integer'max runtime evaluation e v a l BourneShell, Common

runtime evaluation

eval

BourneShell, Common Lisp, Emacs Lisp, FishShell, JavaScript, Matlab, Perl, Perl6, PHP, Python, Ruby, Scheme, Tcl, YCP

CoffeeScript.eval(22)

CoffeeScript

exec

Python

evstr / execstr

Scilab

dostring

Lua

9/16/2016

syntax across languages (One Big Page)

doString

Io

evaluate

Forth

Compiler evaluate:

Smalltalk

runtime_compile / compile + execute

Pliant

Compiler.evalExpression or Compiler.parseOzVirtualString

Oz

compile_string

Pike

interpret

Classic REXX

ToExpression

Mathematica

 

run

Logo

XECUTE

MUMPS

do / reduce / compose / load

Rebol

[

]

Tcl

=

(23)

Prolog

manual memory allocationR e b o l [ ] Tcl = (23) Prolog allocation malloc C allocate throw

allocation

malloc

C

allocate throw Forth

new

Ada

deallocation

free

C

free throw Forth

force garbage collectionAda deallocation free C free throw F o r t h doGC Beta GC.start R u

doGC

Beta

GC.start

Ruby

gc

Logo, Maple, Pike

System.gc()

Java

System.gcDo

Oz

System.GC.Collect()

C#, F#

gc.collect()

Python

gc_collect_cycles(24)

PHP5

full_collect

Eiffel

garbage_collect

Mercury, Prolog

9/16/2016

syntax across languages (One Big Page)

collectgarbage

Lua

Collector collect

Io

VM.garbageCollect()

JavaScript

Gc.full_major()

OCaml

Smalltalk garbageCollect

Smalltalk

System.Mem.performGC

Haskell

incremental garbage collection => not needed Perl, Perl6

recycle

Rebol

interp.gc()

E

(ext:gc)

Common Lisp

b o l interp.gc() E (ext:gc) Common Lisp Functions function call f(a,b,   ) Ada, Awk,

Functions

interp.gc() E (ext:gc) Common Lisp Functions function call f(a,b,   ) Ada, Awk, Awk, B, C,

function call

f(a,b,

 

)

Ada, Awk, Awk, B, C, C#, C++, CoffeeScript, CSS, Dylan, E, Eiffel, Erlang, 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

BCPL

the version

 

(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,

 

(25)

Yorick

v = f(a, b,

 

)

or call f a, b,

Classic REXX

a b

f

Forth, PostScript

(a,b,

)‐>&f

or (a,b,

 

)‐>f

Beta

f:a(26)

 

FL

9/16/2016

syntax across languages (One Big Page)

f@a(27)

Mathematica

a // f(27)

Mathematica

a ~ f ~ b(28)

Mathematica

[ f, A, B,

]

Prolog

<xsl:call‐template name="f">

 

<xsl:with‐param name="a" select=a/> <xsl:with‐param name="b" select=b/>

XSLT

</xsl:call‐template>

with no parameter

f

Ada, 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#, 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.call

Ruby

&$f or $f‐>()

Perl

$f.()

Perl6

v

= f()

Classic REXX

call f

Classic REXX, Fortran

f

value(29)

Smalltalk

<xsl:call‐

 

template

XSLT

name="f">/

  template XSLT name="f">/ partial application (in the examples below, a normal call

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

give the first argument

f

a

F#, Haskell, OCaml, SML

f(a)

Mercury

 

f(a,)

merd

&f.assuming(var_name => a) Perl6

functools.partial(f, a)(30) Python

interp alias {} f_a {} f a

Tcl

give the second argument

f(,b)

merd

&f.assuming(b => b) Perl6

9/16/2016

syntax across languages (One Big Page)

flip f b(31)

Haskell

give the first argument to operator ">"

(a

>) Haskell, merd

(>) a F#, OCaml

give the second argument to operator ">"

(> a) Haskell, merd

to operator ">" (> a) Haskell, merd function definition sub f { }   Perl, Perl6

function definition

sub f {

}

 

Perl, Perl6

sub f($para1, $para2,

 

)

{

}

Perl6

def f(para1, para2,

 

):

Python

def f(para1, para2,

 

)

end

 

Ruby

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 {

} def

 

PostScript

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

 

end

Lua

function f;

;

end

 

FishShell

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 }

 

end

 

Oz

fun f para1 para2 =

 

SML

9/16/2016

syntax across languages (One Big Page)

proc f {para1 para2} {

 

}

Tcl

function retval = f(para1, para2) retval =

 

Matlab, Scilab

:‐ func f(typ1, typ2,

 

)

= typ0.

Mercury

f(Para1, Para2,

)

=

function f(para1 : type1; para2 : typ2;

 

)

return retval is

 

begin

 

Ada

end f;

function f para1 para2 ‐> retval arg typ1 para1; arg typ2 para2; arg rettyp retval;

Pliant

function f(para1 : typ1, para2 : typ2, var retval : typ0;

 

)

: retval;

 

begin

 

Pascal

end

f

(para1 : typ1; para2, para3 : typ2;

)

: rettyp is

 

do

Eiffel

end

 

<xsl:template name="f"> <xsl:param name="para1"/> <xsl:param name="para2"/>

   

</xsl:template>

 

XSLT

Function f(para1, para2)

 

End Function

Visual Basic

:

f

;

Forth

f() {

 

}

BourneShell, KornShell

f

: procedure

 

return retval

 

Classic REXX

to f :para1 :para2

 

end

 

Logo

procedures

procedure f(para1 : typ1; para2, para3 : typ2);

   
 

begin

Pascal

end

f

(para1 : typ1; para2, para3 : typ2;

)

is

 

do

Eiffel

end

procedure f(para1 : typ1; para2 : MODE type2;

)

is

 
 

begin

end f;

 

Ada

MODE ::= | OUT | IN OUT

void f(typ1 para1, typ2 para2,

)

{

}

C, C#, C++, Pike

9/16/2016

syntax across languages (One Big Page)

let f(para1, para2,

)

be $(

$)

BCPL

proc { F Para1 Para2 }

 

end

Oz

f

:= proc(para1, para2,

)

end proc

Maple

Sub f(para1, para2)

 

End Sub

Visual Basic

function f(para1, para2)

 

Matlab, Scilab

f

: procedure

return

 

Classic REXX

variable number of arguments

one can use overloading on different number of arguments C++, Java

sub f {

 

@_ }

 

Perl

sub f;

 

$argv; end

 

FishShell

f() {

 

$@ }

 

BourneShell

f

:=

## &

Mathematica

f[params

 

]

:=

params

 

Mathematica

function f(varargin) for i=1:nargin (varargin{i})

 

Matlab

end

function f(varargin) for e=varargin (e)

 

Scilab

end

(args

)

‐>

CoffeeScript

(lambda x

 

)

or(32)

Scheme

predicates

 

f(Para1, Para2,

)

:‐

Prolog

 
  f(Para1, Para2, ) :‐ Prolog   anonymous function sub { my ($a, $b) = @_;

anonymous function

sub { my ($a, $b) = @_;

}

Perl

{

my ($a, $b) = @_;

}(33)

Perl

{

} (arguments are in the stack

 

PostScript

[

]

Logo

{

param(para1, [typ2]para2,

)

}

MSH

{|a, b|

}(34)

Ruby

[:a :b|

]

Smalltalk

[list {a b} {

}]

Tcl8.5

9/16/2016

syntax across languages (One Big Page)

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) {

 

}(35)

PHP5

function(a, b)

 

end

 

Lua

Function[{a, b},

 

](36)

 

Mathematica

fun(a, b) ‐>

 

end

Erlang

fun {$ A B}

end(37)

 

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

')(38)

 

Matlab

method(a, b,

 

)

Io

method(a, b)

 

end method(39)

 

Dylan

create_function(',','

 

')

PHP

delegate(ta a, tb b) {

 

}

C#2

[](ta a, tb b) {

 

}

C++­0x

[](ta a, tb b) ‐> typ {

 

}

C++­0x

a, tb b) ‐> typ {   } C + + ­ 0 x function return

function return value

breaks the control flow

return(40)

Ada, Awk, B, BCPL, BourneShell, C, C#, C++, Classic REXX, CoffeeScript, Common Lisp, E, FishShell, Io, Java, JavaScript, Lua, Maple, Matlab, Perl, Perl6, PHP, Pike, Pliant, Python, Rebol, Ruby, Tcl, YCP, Yorick

Return

Mathematica, Visual Basic

9/16/2016

syntax across languages (One Big Page)

RETURN

Modula­3

resultis(41) BCPL

return‐from

xxx

Common Lisp

^

Smalltalk

Exit

Function /

Visual Basic

Exit Sub

exit

Forth

output

Logo

function body is the result

no syntax

needed(42)

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 := val

Eiffel

<function name> = val Visual Basic

<function name> := val Pascal

<retvar name> = val;

Ada, Matlab

function called when a function is not defined (in dynamic languages)name> = val; A d a , M a t l a b AUTOLOAD P e

AUTOLOAD

Perl

AUTOSCALAR, AUTOMETH, AUTOLOAD

Perl6

autoload

PHP5

getattr

Python

method_missing

Ruby

doesNotUnderstand

Smalltalk

noSuchMethod (43)

CoffeeScript, JavaScript

unknown

Tcl

no‐applicable‐method

Common Lisp

doesNotRecognizeSelector

Objective­C

TryInvokeMember(44)

C#

match [name, args] {

}

E

the predicate fail

Prolog

forward

Io

runtime inspecting the caller informationthe predicate fail P r o l o g forward I o

forward I o runtime inspecting the caller information
forward I o runtime inspecting the caller information

9/16/2016

syntax across languages (One Big Page)

caller

Perl, Perl6, Ruby

call

Io

inspect.stack()[1]

Python

backtrace

Pike

debug_backtrace

PHP5

trace 'I'

Classic REXX

evalin('caller',

)

Matlab

current_predicate

Prolog

thisContext sender

Smalltalk

where(2)

Maple

info level

Tcl

function compositionk where(2) M a p l e info level T c l . Haskell ~ merd

.

Haskell

~

merd

o

SML

@

Maple

compose

Dylan

Composition

Mathematica

<<

F#

>>

F#

identity functionMathematica << F# >> F# id Haskell identity Common Lisp Identity

id

Haskell

identity Common Lisp

Identity Mathematica

yourself Smalltalk

Lisp Identity Mathematica yourself Smalltalk Control Flow sequence , C, C++, JavaScript, Matlab, Perl,

Control Flow

sequenceIdentity Mathematica yourself Smalltalk Control Flow , C, C++, JavaScript, Matlab, Perl, Pike, Prolog, Scilab

,

C, C++, JavaScript, Matlab, Perl, Pike, Prolog, Scilab

.

Smalltalk

 

Ada, Awk, B, Beta, BourneShell, C, C#, C++, E, F#, FishShell, GNU­sed, Haskell, Io,

;

Java, JavaScript, Maple, Mathematica, Matlab, merd, Modula­3, OCaml, Pascal, Perl,

9/16/2016

syntax across languages (One Big Page)

 

Perl6, PHP, Pike, PL/I, Pliant, Python, Ruby, SML, Tcl, YCP

:

Maple

nothing,

optionally ; Classic REXX, Lua

space

Eiffel, Rebol

endofline Assembler, Awk, Basic, BourneShell, CoffeeScript, E, F#, FishShell, Fortran, GNU­sed, Haskell, Io, JavaScript, Lua, Matlab, merd, Pliant, Python, Ruby, Tcl

(begin

)

Scheme

(progn

)

(prog1

)

Common Lisp, Emacs Lisp

(prog2

)

>>

Haskell

if_then  

if_then

 

if c then

 

CoffeeScript, F#, merd, OCaml, Pascal, Tcl

if c then

 

end

Eiffel, Lua, Oz, Ruby

if c then

 

end if

Ada, Maple

if c then

 

fi

Maple

if c; then

 

fi

BourneShell

if (c) then

end

Dylan

if c do

 

BCPL

IF c THEN

 

END

Modula­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):

 

endif

PHP

if c {

}

Perl6

if c [

]

Logo

if (c) {

 

}

E, Perl, Yorick

IF c

 

MUMPS

c

‐>

FL

c

if

PostScript

 

if c

 

Perl, Ruby

c

if b1 then

 

Forth

(if c

 

)

Common Lisp, Scheme

(when c

 

)

Emacs Lisp

c

and

Perl, Ruby

9/16/2016

syntax across languages (One Big Page)

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 Then

 

Visual Basic

If c

 

End If

 

Visual Basic

if c;

 

end

Ruby

if c;

;

end

FishShell

if c,

,

end

Matlab

if c

 

end

 

Matlab, Ruby

if c then ;

   

if c then

 

if c then do

 

Classic REXX

end

 

c

and

Perl

t

label

GNU­sed

if c

 

CoffeeScript

t label GNU­sed i f c   CoffeeScript if_then_else if c then b1 else b2 CoffeeScript,

if_then_else

if c then b1 else b2

CoffeeScript, F#, Haskell, merd, OCaml, SML

if c then b1 else b2 end

Eiffel, Lua, Ruby

if c then b1 elsif c2 then b2 else b3 end if

Ada

if c then b1 elseif c2 then b2 else b3

end

Eiffel, Oz

if (c) then b1 elseif (c2) then b2 else b3 end

Dylan

IF c THEN b1 ELSIF c2 THEN b2 ELSE b3

END

Modula­3

If c Then b1 ElseIf c2 Then b2 Else b3 End If

Modula­2

if (c) b1 else b2

Awk, B, C, C#, C++, Java, JavaScript, Pike, YCP

if c b1 elsif c2 b2 b3

Tcl

9/16/2016

syntax across languages (One Big Page)

if c then b1 elseif c2 then b2 else b3

Tcl

if c then begin b1 end else begin b2

Pascal

 

end

if c b1 eif c2 b2 else b3

Pliant

if c then b1 elif c2 then b2 else b3 end if

Maple

if c; then b1; elif c2; then b2; else b3; fi

BourneShell

if c; b1; else b2; end

FishShell

if c1, b1, elseif c2, b2, else, b3, end Matlab

if (c) b1 elseif (c2) b2 else b3

PHP

if (c): b1 elseif (c2): b2 else: b3

PHP

endif

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 ; b2

FL

if(c, b1, b2)

Io

If[c, b1, b2]

Mathematica

if(c) then(b1) else(b2)

Io

c

ifTrue: b1 ifFalse: b2

Smalltalk

ifelse c [b1] [b2]

Logo

shunt c b1 c2 b2 b3

Pliant

either c b1 b2 / if/else c b1 b2

Rebol

(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 ; b3

Prolog

case when c; b1 when c2; b2 else b3 end Ruby

 

test c then b1 or b2

BCPL

e

| c = b1 | c2 = b2 | otherwise =

Haskell

b3(45)

c

b1 b2 ifelse

PostScript

c

if b1 else b2 then

Forth

c

? b1 : b2

Awk, B, C, C#, C++, Java, JavaScript, Perl, PHP, Ruby, Tcl, YCP, Yorick

9/16/2016

syntax across languages (One Big Page)

c

?? b1 !! b2

Perl6

b1 if c else b2(30)

Python

$SELECT(c:b1,c2:b2,1:b3)

MUMPS

c

‐> b1, b2

BCPL

(if c then b1 else b2 fi)

Beta

<xsl:choose>

 
 

<xsl:when test="c"> b1 </xsl:when> <xsl:when test="c2"> b2 </xsl:when>

XSLT

<xsl:otherwise> b3 </xsl:otherwise>

</xsl:choose>

If c Then b1 Else b2

Visual Basic

If c

 
 

b1

Else

Visual Basic

 

b2

End If

 

if c:

 

b1

elif c2:

Python

 

b2

else:

 

b3

if c

 
 

b1

elsif c2

 

b2

Ruby

else

 

b3

 

end

if c

 
 

b1

elseif c2

 

b2

Matlab

else

 

b3

end

if c then ; b1 ; else ; b2

 

if c then

 

b1

else

 

b2

if c then do

Classic REXX

 

b1

end

else do

 

b2

end

IF c

ELSE

MUMPS

if c

 
 

b1

9/16/2016

syntax across languages (One Big Page)

else if c2

CoffeeScript

b2

else

 

b3

ifnot_then (unless)else if c2 CoffeeScript b2 else   b3 unless CoffeeScript, Emacs Lisp, Perl ifFalse

unless

CoffeeScript, Emacs Lisp, Perl

ifFalse

Smalltalk

if(c) not then(

)

Io

multiple selection (switch)Perl ifFalse Smalltalk if(c) not then( ) Io switch (val) { case v1: ; break;  

switch (val) { case v1:

;

break;

 

case v2: case v3:

;

break;

C, C++, Java, JavaScript, PHP, Pike

default:

;

}

switch val { case v1:

;

goto done;

   

case v2: case v3:

; goto done;

}

B

;

done:

switch (val) { case v1:

;

break;

 

case v2: case v3:

; break;

default:

;

break;

C#

}

(46)

switch (val) { match v1 { match v2 { match _ {

 

}

 

}

E

}

}

switchon val

 

case v1:

BCPL

case v2:

default:

 

switch val

 

case v1

case v2 v3

case '*'

FishShell

end

switch val

 

case v1

case {v2,v3}

Matlab

otherwise

9/16/2016

syntax across languages (One Big Page)

end

   

case val of v1 :

;

   
 

v2, v3 :

Pascal

else

end

 

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 ‐>

F#, OCaml

|

v2 | v3 ‐>

 

|

_

‐>

 

case val of v1 =>

 

SML

 

|

v2 =>

|

_

=>

CASE val OF v1 =>

 

Modula­3

|

v2 => ELSE =>

 

END

case val of v1 ‐> v2 ‐>

 

Haskell

 

‐>

_

val case

   
 

v1 of

endof

v2 of

endof

endcase

 

Forth

val.

   
 

v1 ‐>

merd

v2 ‐>

‐>

 

_

(case val

   
 

((v1)

)

Common Lisp

((v2)

)

(otherwise

))

 

(case val

   
 

((v1)

)

Scheme

((v2)

)

(else

))

 

9/16/2016

syntax across languages (One Big Page)

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 {

 

},

 

},

Perl

); if ($case{val}) { $case{val}‐>() } else {

}

use Switch; switch ($val) { case v1 { case v2 { else

})

}

 

}

Perl

(47)

given $val { when v1 { when v2 { default {

 

}

 

}

Perl6

}

}

Select val

   
 

Case v1

Case v2, v3

 

Case Else

 

Visual Basic

End Select

 

switch (val) {

   
 

v1 {

}

v2 {

}

MSH

default {

 

}

}

switch val [

   
 

v1 [

]

v2 [

]

]

Rebol

9/16/2016

syntax across languages (One Big Page)

 

switch/default [

   
 

v1 [

]

v2 [

]

][

]

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

 

SQL92

END

loop

loop

forever loop

loop

CoffeeScript, merd, Perl6, PostScript, Ruby

loop(

)

Io

loop

end loop

Ada

LOOP

END

Modula­3

(loop do

)

Common Lisp

cycle (# do

#) Beta

repeat

Squeak

begin

again

Forth

forever

Logo, Rebol

Do

 

Visual Basic

Loop

do forever

 
 

Classic REXX

end

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 loop

Ada

while c do

BCPL, Pascal, SML

while c do

done

F#, OCaml

while c do

end do

Maple

while c do

end

Lua

9/16/2016

syntax across languages (One Big Page)

WHILE c DO

 

END

 

Modula­3

while c:

 

Python

while c; do

 

;

done

BourneShell

while c;

;

end

FishShell

while c,

,

end

Matlab

while [c][

 

]

Rebol

while c [

]

Logo

while(c,

)

Io

While[c,

]

Mathematica

do.while [

 

]

c

Logo

c whileTrue:

 

Smalltalk

(loop while c do

)

Common Lisp

loop (# while ::< (# do c ‐> value #)

Beta

do

#)

begin c while

 

repeat

Forth

from until not c loop

end

Eiffel

while c

Pliant

while c do

 

F#

Do While c

 
 

Visual Basic

Loop

do while c

 
 

Classic REXX

end

do something until condition

 

do

until c

 

Perl6

do {

}

until c

 

Perl

do

while (!c)

 

Awk, C, C#, C++, Java, JavaScript, Pike, Yorick

begin

end until c

 

Ruby

begin

c until

 

Forth

REPEAT

UNTIL c

 

Modula­3

loop (# until ::< (# do c ‐> value #) do

#) Beta

loop

exit when c; end loop

 

Ada

(loop do

 

until c)

 

Common Lisp

repeatuntil c

 

BCPL

repeat

until c

 

Lua, Pascal

9/16/2016

syntax across languages (One Big Page)

repeat

 

until (c)

YCP

repeat,

 

,

c

Prolog

until [

 

c]

Rebol

until c [

 

]

Logo

do.while [

 

]

c

Logo

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,

,

end

Matlab

for i = 1, 10 do

 

end

Lua

for i := 1 to 10 do

 

Pascal

for i = 1 to 10 do

done

F#, OCaml

For i = 1 To 10

 

Next

Visual Basic

for i in 1

10 loop

end loop

 

Ada

for i in 1

10 do

done

 

F#

for i in [1

10]

CoffeeScript

for i in xrange(1, 11)

 

Python

for i in (seq 10);

;

end

FishShell

FOR I=1:1:10

 

MUMPS

for i from 1 to 10 do

end do

 

Maple

for [i 1 10 +1] [

]

Logo

for {set i 1} {$i <= 10} {incr i} {

}

Tcl

1

1 10

for

 

PostScript

11 1 do

loop

Forth

(1

10).each

{|i|

}

Ruby

1.upto(10) {|i|

 

}

Ruby

1

to(10) foreach(

)

 

9/16/2016

syntax across languages (One Big Page)

 

Io

1

to: 10 do: [

]

Smalltalk

(loop for i from 1 to 10 do

)

Common Lisp

do label i = 1, 10

 

Fortran

Do[

,

{i, 1, 10}](48)

 

Mathematica

do i = 1 for 10

 

end

Classic REXX

for each value in a numeric range, 1 decrement

for X := 10 downto 1 do

 

Pascal

for i = 10 downto 1 do

done

 

F#, OCaml

for i in reverse 1

 

10 loop

end loop

 

Ada

for i in 10

‐1

 

1 do

done

 

F#

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 = 1; i <= 10; i‐‐)

 

Awk, JavaScript

for ($i = 1; $i <= 10; $i‐‐)

 

PHP

from i := 10 until i < 1 loop

i := i ‐ 1 end Eiffel

for i = 10:‐1:1,

,

end

Matlab

for i = 10, 1, ‐1 do

 

end

Lua

For i = 10 To 1 Step ‐1

 

Next

Visual Basic

for i in xrange(10, 0, ‐1)

 

Python

for i in `seq 10 ‐1 1`; do

;

done

BourneShell

for i in (seq 10 ‐1 1);

;

end

FishShell

for i from 10 to 1 by ‐1 do

 

end do

 

Maple

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

for

PostScript

1

10 do

‐1 +loop

Forth

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, ‐1

   

9/16/2016

syntax across languages (One Big Page)

 

Fortran

Do[

,

{i, 10, 1, ‐1}]

Mathematica

do i = 10 to 1 by ‐1

 

end

Classic REXX

for i in [10

1]

CoffeeScript

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 end Eiffel

for i = 1:3:10,

,

end

Matlab

for i = 1, 10, 2 do

 

end

Lua

For i = 1 To 10 Step 2

 

Next

Visual Basic

for i in 1

2

10 do

 

done

F#

for i in xrange(1, 11, 2)

 

Python

for i in (seq 1 2 10);

;

end

FishShell

for i from 1 to 10 by 2 do

end do

 

Maple

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

for

PostScript

11 1 do

2 +loop

 

Forth

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, 2

 

Fortran

Do[

,

{i, 1, 10, 2}]

 

Mathematica

do i = 1 to 10 by 2

 
 

Classic REXX

end

 

for i in [1

10]

by 2

CoffeeScript

for "a la C" (while + initialisation)

CoffeeScript for "a la C" (while + initialisation)
CoffeeScript for "a la C" (while + initialisation)

9/16/2016

syntax across languages (One Big Page)

for

Awk, C, C#, C++, Java, JavaScript, Mathematica, MSH, Perl, PHP, Pike, Tcl, Yorick

loop

Perl6

for ((x = 0; x < 10; x++)); do

;

done

BourneShell

from init_code until c loop incr_statement end

Eiffel

(loop with VAR = INITIAL‐VALUE CONDITION finally INCREMENT

)

while

Common Lisp

CONDITION finally INCREMENT ) while Common Lisp breaking control flow returning a value return (40) Ada,

breaking control flow

returning a value

return(40)

Ada, Awk, B, BCPL, BourneShell, C, C#, C++, Classic REXX, CoffeeScript, Common Lisp, E, FishShell, Io, Java, JavaScript, Lua, Maple, Matlab, Perl, Perl6, PHP, Pike, Pliant, Python, Rebol, Ruby, Tcl, YCP, Yorick

Return

Mathematica, Visual Basic

RETURN

Modula­3

resultis(41) BCPL

return‐from

xxx

Common Lisp

^

Smalltalk

Exit

Function /

Visual Basic

Exit Sub

exit

Forth

output

Logo

goto (unconditional jump)

goto

Ada, B, Basic, BCPL, C, C#, C++, Cobol, Fortran, Logo, MUMPS, Pascal, Perl, PHP5, Yorick

Goto

Mathematica

go throw Common Lisp

signal

Classic REXX

b

GNU­sed

b, bra,

Assembler

jmp

continue / break

continue / break

Awk, C, C#, C++, CoffeeScript, E, FishShell, Io, Java, JavaScript, Matlab, PHP, Pike, Python, Tcl, YCP, Yorick

Continue / Break

Mathematica

next / last

Perl, Perl6

next / break(49)

Maple, Ruby

9/16/2016

syntax across languages (One Big Page)

/ break BCPL, Lua

/

break

break

BCPL, Lua

 

/

break/return

Rebol

 

/

exit

Ada, PostScript

 

/

stop

Logo

 

restart / leave

Beta, Pliant

 

/

Exit Do, Exit For Visual Basic

 

return‐from xxx or return

/

Common Lisp

 

iterate / leave

Classic REXX

 

/

leave

Forth

redo / retry

redo/

Perl, Perl6

redo / retry Io, Ruby

redo/ Perl, Perl6 redo / retry I o , R u b y exception throwing raise

exception

throwing

raise

Ada, Eiffel, F#, merd, OCaml, Python, Ruby, Scheme­SRFI34, SML

RAISE

Modula­3

raise

end

Oz

Exception raise

Io

throw

C#, C++, CoffeeScript, E, Erlang, Forth, Haskell, Java, JavaScript, Logo, PHP5, Pike, Prolog, Rebol

Throw

Mathematica

throw/name

Rebol

die

Perl, Perl6

return ‐code

Tcl

error

Common Lisp, Dylan, Emacs Lisp, Lua, Lua, Maple, Matlab, Pliant, Yorick

signal

Common Lisp, Dylan, Smalltalk

signal predefined_condition_name Classic REXX

cerror warn

Common Lisp

[NSException raise:name ]

Objective­C

catching

try: a except exn:

Python

try a with exn ‐>

F#, OCaml

9/16/2016

syntax across languages (One Big Page)

try a catch (exn)

 

C#, C++, Java, JavaScript

try a

 

catch exn

CoffeeScript

try {

} catch(t $v) {

}

PHP5

try a catch exn then

 

end

Oz

try a catch exn:

 

end try

 

Maple

try(a) ; catch(

)

Io

try { a CATCH exn {

 

} }

Perl6

TRY a EXCEPT exn =>

 

END

Modula­3

a handle exn =>

 

SML

a on: exception_name do: [:exn |

]

Smalltalk

ifCurtailed

 

Smalltalk

rescue

Eiffel, Ruby

eval {a}; if ($@)

 

Perl

exception when exception_name =>

 

Ada

catch a (\exn ‐>

 

)

Haskell

catch

Erlang, Forth, Logo, Prolog, Rebol, Tcl

Catch

Mathematica

catch/name

 

Rebol

catch(

)

or catch {

};

Pike

if (catch(exn)) {

 

} a

Yorick

pcall

Lua

with‐exception‐handler or guard

 

Scheme­SRFI34

block a exception(exn)

end

Dylan

?, shy, safe

 

Pliant

handler‐bind handler‐case ignore‐errors Common Lisp

NS_DURING a NS_HANDLER

NS_ENDHANDLER Objective­C

try

 

a

catch

Matlab

end

signal on predefined_condition_name

   

predefined_condition_name :

 

Classic REXX

cleanup: code executed before leaving

  Classic REXX cleanup: code executed before leaving
  Classic REXX cleanup: code executed before leaving

9/16/2016

syntax across languages (One Big Page)

ensure

Ruby, Smalltalk

finally

C#, F#, Java, Maple, Python

FINALLY

Modula­3

unwind‐protect Common Lisp, Emacs Lisp

cleanup

Dylan

dynamic‐wind

Scheme

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

retry Eiffel, Ruby, Smalltalk restart Dylan
retry Eiffel, Ruby, Smalltalk
restart Dylan

resume execution where the exception took place

resume Smalltalk

call­with­current­continuation

call‐with‐current‐continuation(50) Scheme

callcc

Ruby, SML­NJ

(50) S c h e m e callcc Ruby, SML­NJ Types declaration typedef t n C,

Types

declaration(50) S c h e m e callcc Ruby, SML­NJ Types typedef t n C, C++,

typedef t n

C, C++, Pike

type n is t

Ada

type n

Pliant

type n = t

F#, Haskell, OCaml, Pascal, SML

TYPE n = t

Modula­3

using n =

C#

data n = t

Haskell

datatype n = t

SML

newtype n = t

Haskell

n

= t

merd, Python

n

:

t

Beta

(deftype n () 't) Common Lisp

annotation (or variable declaration)(deftype n () 't) C o m m o n L i s p : Ada,

:

: Ada, E, Eiffel, F#, Modula­3, OCaml, Pascal, SML

Ada, E, Eiffel, F#, Modula­3, OCaml, Pascal, SML

: Ada, E, Eiffel, F#, Modula­3, OCaml, Pascal, SML

9/16/2016

syntax across languages (One Big Page)

 

::

Dylan, Haskell, Mercury

 

!!

merd

t

v

C, C#, C++, Java, Perl6, Pike, Pliant, YCP

(declare (t v)) Common Lisp

v

:@ t

Beta

_t(51)

Mathematica

L i s p v :@ t Beta _t (51) Mathematica cast upcast (t) e C,

cast

upcast

(t)

e

C, C#, C++, Java, PHP

t(e)

 

Ada, Pascal

[t]

e

Pike

static_cast<t>(e) C++

e

:> t

OCaml

e

:

t

F#

upcast e

F#

CAST(e as t)

SQL92

typecast(e,t)

Matlab

downcast (need runtime checking)

(t)

e

Java

t(e)

 

Ada

e

:

t

E

[t]

e

Pike

dynamic_cast<t>(e) C++

e

as t

C#

e

:?> t

F#

downcast e(52)

F#

v

?= e(53)

Eiffel

NARROW(e, t)

Modula­3

typecast(e,t)

Matlab

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

(t)

e

C++, Pike

[t]

e

MSH

t(e)

 

C++, Matlab, Python

t

e

 

9/16/2016

syntax across languages (One Big Page)

 

F#

e

:

t

E

e

:: t

Haskell

cast e t

Pliant

 

cast t

Pliant

make t e / to t e Rebol

mutability, constnesst P l i a n t make t e / to t e R e

type of a mutable value

mutability is the default C, C#, C++, Java, Matlab

val x: T

Pascal

T

ref

F#, OCaml, SML

STRef a T

Haskell

in out T(54)

Ada

type of a constant value

const T

C++, C99

constant T

Ada

const x: T

Pascal

constness is the default F#, Haskell, OCaml, SML

special cases

"readonly" fields(55)

C#

"final" fields, parameters, local variables(55) Java

fields, parameters, local variables (55) J a v a Object Oriented & Reflexivity method invocation

Object Oriented & Reflexivity

method invocationvariables (55) J a v a Object Oriented & Reflexivity object.method(para) Ada, Beta, C#, C++, Cecil,

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 para

OCaml

object:method(para)

Lua

object method(para)

Io

object method para

Pliant, Tcl

object method: para1

method_continuation:

Smalltalk

para2

9/16/2016

syntax across languages (One Big Page)

object <‐ method(para)

E

(56)

[

object method: para

Objective­C

]

object‐>method(para)

C++, Perl, PHP, Pike

object["method"](para) Pike

 

object/method para

Rebol

method object para

Haskell, Mercury

(method object para)

Common Lisp

method(object, para)

Ada, Dylan, Matlab

para‐>method

Beta

(send object method para)

MzScheme

with no parameter

object.method

Ada, Eiffel, F#, merd, Perl6, Ruby

object.property(57) C#

 

object.method()

C#, C++, CoffeeScript, E, Java, JavaScript, Python

object#method

OCaml

object:method

Pliant

object‐>method

Perl

object‐>method()

PHP5, Pike

object/method

Rebol

object["method"]()

Pike

object method

Io, Smalltalk

[

object method ]

Objective­C

method object

Haskell, Mercury

(method object)

Common Lisp

method(object)

Ada, Dylan, Matlab

(send object method) MzScheme

Matlab (send object method) M z S c h e m e object creation new PHP,

object creation

new

PHP, 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 new

Smalltalk

9/16/2016

syntax across languages (One Big Page)

class_name( ) F#, Matlab, Pike, Python

class_name(

)

class_name( ) F#, Matlab, Pike, Python

F#, Matlab, Pike, Python

class_name v(

 

)

C++

v

: class_name

Ada

class_name.Create

 

Delphi­Kylix

!class_name!constructor_name(

)

Eiffel

&

Beta

make‐object

 

MzScheme

(make‐instance class_name

 

)

Common Lisp

[class_name alloc]

 

Objective­C

make class_name!

 

Rebol

def object_name {

 

}

E

object cloning 

 
 

o.clone

 

Perl6

 

o.clone(58)

 

Eiffel, Ruby

 

o.deep_clone

 

Eiffel

 

o.clone()

 

Java

o.Clone()

 

C#

clone $o

 

PHP5

 

o

clone

Io

clone / copy or deepCopy Smalltalk

 

Storable::dclone

 

Perl

[o copy]

 

Objective­C

 

copy.copy(o)(59)

 

Python

 

purecopy

 

Emacs Lisp

 

{< >} or Oo.copy o

 

OCaml

 

o2 = o(60)

 

C++, Matlab, PHP

 

$o2 = $o

 

PHP

 

o2.all := o.all

 

Ada

make o []

 

Rebol

 

o_ : T'Class := o(61)

 

Ada

manually call an object's destructorl   o_ : T'Class := o (61)   A d a delete C++, JavaScript destroy

delete

C++, JavaScript

destroy

Pike

9/16/2016

syntax across languages (One Big Page)

DESTROY

Perl

dealloc

Objective­C

Dispose

C#, F#

del,

del

Python

destruct

PHP5

Requires instantiation of Ada.Unchecked_Deallocation Ada

class declarationinstantiation of Ada.Unchecked_Deallocation A d a class C#, C++, CoffeeScript, Haskell, Java, Matlab,

class

C#, C++, CoffeeScript, Haskell, Java, Matlab, MzScheme, OCaml, Perl6, PHP, Pike, Python, Ruby

class c inherit p1 p2

 

feature

Eiffel

decl decl

end

defclass defstruct

 

Common Lisp

subclass

Smalltalk

struct

C++

type

Pliant

type c is tagged record

end

Ada

record(62)

@interface c {

}

@end

Objective­C

:

Beta

type c() = class

 

end

F#

type c() =

F#

testing class membershiptype c() = class   end F # type c() = F# isa Matlab, Perl is_a?

isa

Matlab, Perl

is_a? kind_of?

Ruby

o.meta.isa

Perl6

isKindOf(63)

Smalltalk

isKindOfClass

Objective­C

dynamic_cast

C++

instanceof

CoffeeScript, Java, JavaScript, PHP5

isinstance

Python

in

Ada

is

C#

is_a

PHP

:?

F#

9/16/2016

syntax across languages (One Big Page)

Program.inherits or Program.implements

Pike

entry_type

Pliant

typep

Common Lisp

ISTYPE

Modula­3

object## < classname##

Beta

type.accepts(object) / object =~ v : type E

var ?= val(64)

Eiffel

get the type/class corresponding to an object/instance/value=~ v : type E var ?= val (64) E i f f e l class

class

Matlab, Objective­C, Ruby, Smalltalk

class

Python

getClass

Java

get_class

PHP

GetType

F#

typeid

C++

typeof

C#, CoffeeScript, JavaScript

type‐of

Common Lisp

type

Io

ref

Perl

generator

Eiffel

meta

Perl6

object_program Pike

getAllegedType E

methods availablePerl6 object_program P i k e getAllegedType E methods Matlab, Ruby get_class_methods P H P

methods

Matlab, Ruby

get_class_methods

PHP

getMethods

Java

get‐member

MSH

indices

Pike

o.meta.getmethods

Perl6

dir

Python

slotNames

Io

o.GetType().GetMethods()

F#

o class selectors / o class allSelectors Smalltalk

9/16/2016

syntax across languages (One Big Page)

o

getAllegedType().getMessageTypes()

E

inheritanceBig Page) o getAllegedType().getMessageTypes() E   child :< parent B e t a   class

 

child :< parent

Beta

 

class child : parent

C#, C++

 

class child < parent end

Ruby

 

class child is parent {

}

Perl6

 

class child extends parent

CoffeeScript, Java, PHP5

class child(parent):

Python

 

class child inherit parent end

 

Eiffel

 

parent subclass: child

Smalltalk

 

make parent

Rebol

 

inherit

OCaml, Pike

 

def child extends makeSuperObject(parent,

)

{

} E

type child is new parent with record

end record

Ada

 

type child = inherit parent

F#

 

(defclass child (parent)

)

Common Lisp

 

@interface child : parent {

}

@end

Objective­C

 

@ISA = qw(parent1 parent2)

Perl

 

clone , setProtos, setProto, prependProto, appendProto Io

 

instance Parent Child where

Haskell

 

has the method 

 
 

can

Perl, Perl6

respond_to?

Ruby

respondsTo

E, Smalltalk

respondsToSelector

Objective­C

hasattr(obj, "meth")(65)

Python

object‐>method

Pike

all [in object 'method function? get in object 'method] Rebol

 

find‐method

Common Lisp

ismethod

Matlab

hasSlot

Io

try obj.GetType().GetMethod("meth") with

 

F#

9/16/2016

syntax across languages (One Big Page)

obj.meth? instanceof Function

CoffeeScript

method_exists

PHP5

current instanceFunction CoffeeScript method_exists P H P 5   Beta, C#, C++, CoffeeScript, Java, JavaScript, PHP,

 

Beta, C#, C++, CoffeeScript, Java, JavaScript, PHP,

this

Pike

THIS

Simula

self

Io, Objective­C, Rebol, Ruby, Smalltalk

object_name if defined as: def object_name { }

E

Current

Eiffel

first parameter(66)

Matlab, Perl, Pliant, Python

the object variable

F#

dispatching parameter

Ada, Common Lisp

Me

Visual Basic

.

Perl6

accessing parent methodm o n L i s p Me Visual Basic . Perl6 super CoffeeScript, E, Java,

super

CoffeeScript, E, Java, Objective­C, Ruby, Smalltalk

super(Class, self).meth(args)

Python

base

C#

resend

Io

Precursor

Eiffel

$o.SUPER::method(

)

Perl6

$o‐>SUPER::method(

)

Perl

method(parent(dispatching‐parameter)) Ada

 

parent(dispatching‐parameter).method Ada

 

parent::method

 

PHP5

call‐next‐method

 

Common Lisp

type foo2 = inherit foo as parent

F#

member

=

parent.meth

accessing child method= inherit foo as parent F# member = parent.meth inner Beta

inner Beta
inner Beta

9/16/2016

syntax across languages (One Big Page)

Package, Module

package scopesyntax across languages (One Big Page) Package, Module   Ada, C#, CoffeeScript, E, F#, Haskell, Java,

 

Ada, C#, CoffeeScript, E, F#, Haskell, Java, Modula­3, OCaml, Pascal, Python, Ruby, SML,

.

Squeak

:

XML

::

C++, merd, Perl, Ruby, Squeak, Tcl, YCP

:

::

(67)

Common Lisp

:‐

Maple

'

Perl

`

Mathematica

 

Mercury

/

Matlab

declarePerl ` Mathematica   Mercury / Matlab package p;   Java, Perl namespace p {  

package p;

 

Java, Perl

namespace p {

 

}

C#, C++

namespace p

 

F#

namespace P;

 

PHP5

namespace eval p

 

Tcl

module p where

 

Haskell

module P

end

Ruby

module P = struct

end

OCaml

{

module "p";

}

YCP

:‐ module(p)

 

Prolog

p

= module()

end module

 

Maple

(defpackage p

 

)

Common Lisp

automatically done based on the file name

OCaml, Python, Tcl8.5

package declare(68)

 

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;

Ada

9/16/2016

syntax across languages (One Big Page)

package body p is ‐‐ Define package implementation here end p;

package body p is ‐‐ Define package implementation here end p;

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 module

Maple

 

Common

(export 'name1 'name2)

 

Lisp

   

Java,

attached to each name (public, private

)

Pike

namespace export name1

 

Tcl

namespace p val name1 : type1

 

F#

append_features

 

Ruby

module type PType = sig val name1 : type1

 

end

OCaml

module P : PType

 

= struct

end

all files in package directory are exported. files in /private sub‐directory are not exported, but can be used by the package itself

Matlab

all

=

[

]

Python

import

import

everything into current namespace

use p(69)

Perl

uses p

Pascal

using p

C#

using namespace p;

C++

(use‐package 'p)

Common Lisp

open p

F#, OCaml

import

Pike

import p

Haskell

IMPORT p;

Modula­2

import p.*

Java

import "p"

YCP

from p import *

Python

with p; use p;

Ada

9/16/2016

syntax across languages (One Big Page)

namespace import p *

   

Tcl

 

inherit c export {NONE} all end Eiffel

include or even extend

 

Ruby

do

Rebol

addpath

 

Matlab

.

p

BourneShell

source p

 

BourneShell

builtin ‐f /path/to/lib.so

 

KornShell

<< 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.name2

 

Java

(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 name1

 

Tcl

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 p

Python

use p;(70)

Perl

require p

Perl

require "p"

Ruby

require, "p"

Yorick

(require 'p)(71)

Common Lisp

with p;

Ada

9/16/2016

syntax across languages (One Big Page)

with(p)

Maple

package require p

Tcl

automatically done(72) Java, OCaml

automatically done (72) J a v a , O C a m l Strings type name

Strings

type namedone (72) J a v a , O C a m l Strings char[] C char

char[]

C

char const[]

C++

string

C#, C++, F#, Maple, OCaml, Pascal, PHP, Pike, SML, YCP

string!

Rebol

String

Ada, C#, CoffeeScript, Haskell, Java, JavaScript, merd, Ruby, Smalltalk, Visual Basic

STRING

Eiffel

str

Python, YAML

Str

Perl6, Pliant

NSString *

Objective­C

CHAR,

SQL92

VARCHAR(size)

Sequence

Io

character type nameS Q L 9 2 VARCHAR(size) Sequence I o char C, C#, C++, F#, OCaml, SML

char

C, C#, C++, F#, OCaml, SML

char!

Rebol

Char

Haskell, merd, Perl6

Character Ada, Smalltalk

CHARACTER Eiffel

character "z"Character Ada, Smalltalk CHARACTER E i f f e l ' z ' Ada, B, C,

'z'

Ada, B, C, C#, C++, Classic REXX, E, Eiffel, F#, Haskell, Matlab, OCaml, Pascal, Pike

"z"

BourneShell, Classic REXX, Maple, merd

"z

Logo

$z

Smalltalk

#\z

Common Lisp, Scheme

#"z"

Rebol, SML

9/16/2016

syntax across languages (One Big Page)

&z

Oz

?z

Emacs Lisp, Ruby

char z, [char]

Forth

z(73)

Emacs Lisp, Ruby char z, [char] Forth z (73) strings with no interpolation of variables '

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, XPath, YAML

"

"

Ada, Awk, C, C#, C++, Classic REXX, Common Lisp, CSS, Dylan, E, Eiffel, Emacs Lisp, F#, FL, 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'

 

MARK

BourneShell, Perl, Ruby

<<<'MARK'

 

MARK(74)

 

PHP5

{

{

}

}

Tcl

(

)

PostScript

q(

(

)

),

q[

],

q{

},

Perl, Perl6

q<

>,

q/

/

%q(

 

(

)

),

%q[

],

Ruby

%q{

},

%q<

>,

 

%q/

/

q(

(

)

)

merd

@"

""

"

C#

s"

"

Forth

@"

"

Objective­C

with interpolation of variables

(75)

 

Tcl

"

$v

"

BourneShell, FishShell, Perl, Perl6, PHP, Tcl

9/16/2016

syntax across languages (One Big Page)

"

{v}

"

merd

"

#{v}

"

"

#$v

"

"

#@v

"

"

#@@v

CoffeeScript, Ruby

 

"

<<MARK

$v

MARK

 

BourneShell, Perl

<<MARK

#{v}

 

MARK

 

Ruby

<<<MARK

$v

MARK

 

PHP

qq(

(

$v

)

),

qq[

 

],

qq{

},

qq<

>,

Perl, Perl6

qq/

/

%Q(

(

#{v}

 

)

),

%Q[

],

%Q{

},

%Q<

>,

Ruby

%Q/

/

qq(

(

{v}

)

)

merd

"

#{v}

"

interpolate

 

Io

"

%(v)s

"

% vars()

 

Python

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

\n

Tcl

"\n"

C, C#, C++, CoffeeScript, FishShell, Haskell, Io, Java, JavaScript, Lua, Maple, Mathematica, OCaml, Perl, Perl6, PHP, Pike, Python, Ruby, YCP, Yorick

"*n"

B, BCPL

"%N"

Eiffel

"^/"

Rebol

"~%"(76) Common Lisp

"[lf]"

Pliant

vb_nl

Visual Basic

<N>(77) Smalltalk

vb_nl Visual Basic <N> (77) Smalltalk multi­line all strings allow multi‐line strings

multi­line

all strings allow multi‐line strings

BourneShell, 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"

 

C

"

\n"

 
 

" \n\

Haskell

\ \n"

9/16/2016

syntax across languages (One Big Page)

"

",

Classic REXX

"

"

"

%N%

Eiffel

%

%N"

"""

"""

CoffeeScript

convert something to a string (see also string interpolation)""" """ CoffeeScript show Haskell to_s, to_str, inspect, String() R u b

show

Haskell

to_s, to_str, inspect, String() Ruby

to_string

merd, Pliant

tostring

Lua, YCP

toString

CoffeeScript, Java, JavaScript

ToString

C#, F#, Mathematica

String

CoffeeScript, JavaScript

perl

Perl6

Dumper

Perl

""

.

e

Perl

"" ~ e

Perl6

"" + e

CoffeeScript, E, Java, JavaScript

string

Pliant

str, `e`, repr

Python

out

Eiffel

cvs

PostScript

T'Image(e)(78)

Ada

asString

Io, Smalltalk

printString

Smalltalk

as(<string>, e)

Dylan

(string) e

PHP, Pike

convert(e,string)

Maple

(coerce e 'string)

Common Lisp

prin1‐to‐string

Emacs Lisp

to string! / to‐string / to ""

Rebol

description

Objective­C

pr1

Yorick

unneeded, all values are strings Tcl

 

serialize (marshalling)unneeded, all values are strings T c l  

9/16/2016

syntax across languages (One Big Page)

 

export‐clixml

MSH

serialize

Io, PHP

Marshal.to_string

OCaml

Marshal.dump

Ruby

Data.Binary.encode

Haskell

BinaryFormatter.Serialize

F#

storeBinaryOn

Smalltalk

Storable::store

Perl

pickle.dump(79)

Python

(with‐standard‐io‐syntax (write obj stream)) Common Lisp

T'Output(78)

Ada

unserialize (un­marshalling) 

 
 

import‐clixml

MSH

unserialize

PHP

Marshal.from_string

OCaml

Marshal.load

Ruby

Data.Binary.decode

Haskell

BinaryFormatter.Deserialize

F#

readBinaryFrom

Smalltalk

pickle.load

Python

(with‐standard‐io‐syntax (read obj stream)) Common Lisp

Storable::store

Perl

doString

Io

T'Input(78)

Ada

sprintf­liker l doString I o T'Input (78) A d a sprintf Awk, C, C++, F#, Maple,

sprintf

Awk, C, C++, F#, Maple, Matlab, merd, OCaml, Perl, Perl6, PHP, Pike, Ruby

printf

Haskell

%

Python, Ruby

format

Java, Lua, Tcl

format(80)

Common Lisp, Erlang, Scheme­SRFI28

Format

C#, F#

putFormat

Beta

stringWithFormat

Objective­C

9/16/2016

syntax across languages (One Big Page)

9/16/2016 syntax across languages (One Big Page) expandMacrosWith (80) S m a l l t a

expandMacrosWith(80) Smalltalk

Storable::retrieve

Perl

simple print

on strings

puts

C, Dylan, Tcl

print

Awk, Basic, Java, Maple, merd, PHP, SML

write

JavaScript, Pascal, Pike, Yorick

putStr

Haskell

print_string

F#, OCaml

console

Pliant

writeln

JavaScript, Pascal

write‐string

Common Lisp

putStrLn

Haskell

Put_Line

Ada

display

Cobol

message

Emacs Lisp

put_string

Eiffel

show

Smalltalk

print_endline(81) OCaml

println(81)

Java, merd

put_chars

Erlang

echo(82)

BourneShell, FishShell, PHP

type

Forth

putText

Beta

say

Classic REXX

p or i

GNU­sed

on simple objects

print

Perl, Perl6

say(81)

Perl6

puts(81)

Tcl

puts ‐nonewline Tcl

on any objects

print

print Io, Logo, Lua, Ruby

Io, Logo, Lua, Ruby

print Io, Logo, Lua, Ruby

9/16/2016

syntax across languages (One Big Page)

print(81)

Dylan, Haskell, Python, Rebol

Print

Mathematica

print e,

Python

println(81)

Io

prin

Rebol

Put

Ada

p(81)

Ruby

puts(83)

Ruby

display

Scheme

write

Common Lisp, Io, Prolog, Scheme

writeln(81)

Io

print

Common Lisp

printOn

Smalltalk

princ prin1

Common Lisp, Emacs Lisp

print_any

F#

WriteLine

C#, F#

nothing ‐ just remove ";" at the end of the expression, and it will print it

Matlab

disp

Matlab

printf­like

printf

Awk, C, C++, F#, Haskell, KornShell, Maple, Matlab, merd, OCaml, Perl, PHP, Ruby

write

Pike

WriteLine C#

putFormat Beta

format(80) Common Lisp, Prolog

putFormat B e t a format (80) Common Lisp, Prolog string equality & inequality eq ne

string equality & inequality

eq ne

Perl, Perl6, Tcl

strcmp

C, Matlab

== !=

CoffeeScript, JavaScript, Pike

== !==

PHP

== ~=

Lua

= \=

Prolog

isEqualToString(84) Objective­C

9/16/2016

syntax across languages (One Big Page)

== !=

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

=== =!= / == !=(19) Mathematica

== ~=

Matlab

equal?

Ruby, Scheme

equals

Java

equal, equalp

Common Lisp

is_equal

Eiffel

isEqual

Objective­C

is_equal E i f f e l isEqual Objective­C string size l e n g t

string size

length

Awk, Beta, C++, CoffeeScript, Common Lisp, Eiffel, F#, Haskell, Java, JavaScript, Maple, Matlab, Objective­C, OCaml, Perl, PostScript, Prolog, Ruby

LENGTH

Classic REXX

'Length

Ada

length?

Rebol

size

C++, E, Io, Ruby, Smalltalk, SML, YCP

Length

C#, F#, Modula­3, Oz, Pascal

len

Pliant, Python, Visual Basic

strlen

C, PHP

string length

Tcl

string‐length

Scheme, XPath

StringLength

Mathematica

sizeof

Pike

count

Eiffel, Logo

bytes chars

Perl6

CHARACTER_LENGTH SQL92

9/16/2016

syntax across languages (One Big Page)

atom_length

Prolog

wc ‐c

FishShell

#

Lua

${#v}

BourneShell

dup(85)

Forth

string concatenationLua ${#v} BourneShell dup (85) F o r t h + C#, C++, CoffeeScript, E, Eiffel,

+

C#, C++, CoffeeScript, E, Eiffel, F#, Java, JavaScript, merd, MSH, Pascal, Pike, Pliant, Python, Ruby, YCP

.

Perl, PHP

 

Io, Lua

,

Smalltalk

~

Perl6

&

Ada, Modula­3, Visual Basic

^

F#, OCaml, SML

 

MUMPS

_

||

Cecil, Classic REXX, Icon, Maple, PL/I, SQL92

++

Haskell

$a$b

BourneShell, FishShell, Tcl

concatenate

Common Lisp, Dylan

string‐append

Scheme

StringJoin

Mathematica

cat

Maple

Cat

Modula­3

strcat

C

concat

XPath

append

Beta, Prolog, Rebol

stringByAppendingString Objective­C

 

Awk, Classic REXX

[string1 string2]

Matlab

word

Logo

duplicate n times[string1 string2] M a t l a b word Logo * Ada, E, Pike, Python, Ruby

*

Ada, E, Pike, Python, Ruby

x

Perl, Perl6

9/16/2016

syntax across languages (One Big Page)

times

merd

repeat

Pliant

repeated

Io

str_repeat

PHP

string repeat

Tcl

strrep

Lua

repmat

Matlab

insert/dup

Rebol

COPIES

Classic REXX

cat(s$n)

Maple

concat $ replicate Haskell

upper / lower case characterM a p l e concat $ replicate H a s k e l l upcase

upcase / downcase

Emacs Lisp, Ruby

uc / lc

Perl, Perl6

upper / lower(86)

Lua, Matlab, Pliant, Python

toUpper / toLower

Haskell

to_upper / to_lower

Eiffel

To_Upper / To_Lower

Ada

toUpperCase / toLowerCase

CoffeeScript, E, Java, JavaScript

upper_case / lower_case

Pike

uppercase / lowercase

F#, Logo, OCaml

strupper / strlower

Lua

strtoupper / strtolower

PHP

ToUpper / ToLower

C#, F#, Oz

toupper / tolower

Awk, C, C++

string toupper / string tolower

Tcl

asLowercase / asUppercase

Io, Smalltalk

upCase / lowCase

Beta

uppercase form / lowercase form

Rebol

char‐upcase / char‐downcase

Common Lisp, Scheme

char_type(C_, to_upper(C)), char_type(C_, to_lower(C)) Prolog

\U / \L / \C

GNU­sed

uppercase / lowercase / capitalized stringP r o l o g \U / \L / \C G N U ­ s

N U ­ s e d uppercase / lowercase / capitalized string
N U ­ s e d uppercase / lowercase / capitalized string
N U ­ s e d uppercase / lowercase / capitalized string
N U ­ s e d uppercase / lowercase / capitalized string

9/16/2016

syntax across languages (One Big Page)

upcase / downcase

Emacs Lisp, Ruby

upper / lower

Matlab, SQL92

upper / lower / capitalize

Python

uppercase/lowercase

F#, Logo, OCaml, Rebol

upcase_atom/downcase_atom

Prolog

toUpperCase / toLowerCase

CoffeeScript, E, Java, JavaScript

ToUpperCase / ToLowerCase

Mathematica

ToUpper / ToLower

C#, F#

to_upper / to_lower

Ada, Eiffel

toupper / tolower

Awk, YCP

uc / lc

Perl, Perl6

UpperCase / LowerCase

Pascal

StringTools[UpperCase] / StringTools[LowerCase] / StringTools[Capitalize]

Maple

uppercaseString / lowercaseString / capitalizedString

Objective­C

UCase / LCase

Visual Basic

strtoupper / strtolower

PHP, Yorick

strupper / strlower

Lua

string toupper / string tolower / string totitle

Tcl

string‐upcase / string‐downcase

Common Lisp, Scheme

asLowercase / asUppercase / asUppercaseFirst

Smalltalk

asLowercase / asUppercase / makeFirstCharacterUppercase

Io

upcase_atom / downcase_atom

Prolog

makeLC / makeUC

Beta

parse upper var in_var out_var / parse lower var in_var out_var

Classic REXX

var in_var out_var C l a s s i c R E X X ascii to

ascii to character

chr

F#, Haskell, OCaml, Pascal, Perl, Perl6, PHP, Python, Ruby, SML

chr$

Visual Basic

char

Matlab

format %c $c

Tcl

toChar

E

strchar

Lua

from_integer

Eiffel

fromCharCode

CoffeeScript, JavaScript

9/16/2016

syntax across languages (One Big Page)

FromCharacterCode

Mathematica

character

Pliant

Character value: c Smalltalk

asCharacter

Io

code‐char

Common Lisp

integer‐>char

Scheme

'Val

Ada

(char) c

C, C#, C++, Java

to char! / to‐char Rebol

X2C, D2C

Classic REXX

$CHAR(s)

MUMPS

char_code

Prolog

ascii

Logo

StringTools[Char] Maple

ascii L o g o StringTools[Char] M a p l e character to ascii   o

character to ascii

 

ord

F#, Haskell, Pascal, Perl, Perl6, PHP, Python, SML

 

asc

Visual Basic

getNumericValue

Java

charCodeAt

CoffeeScript, JavaScript

asciiValue

Smalltalk

 

code

Eiffel, OCaml

char‐code

Common Lisp

char‐>integer

Scheme

 

s[0]

Ruby

s

0 get

PostScript

s

at(0)

Io

scan $s %c

Tcl

strbyte

Lua

toInteger

E

 

'Pos

Ada

 

number

Pliant

(int) c

C, C#, C++, Java

to integer! / to‐integer

Rebol

9/16/2016

syntax across languages (One Big Page)

ToCharacterCode

Mathematica

C2X, C2D

Classic REXX

$ASCII(s)

MUMPS

(done automatically when applying mathematical operations on char, such as +)

Matlab

char

Logo

char_code

Prolog

StringTools[Ord]

Maple

accessing n­th characterP r o l o g StringTools[Ord] M a p l e s[n] C, C#, C++,

s[n]

C, C#, C++, E, Maple, PHP, Pike, Python, Ruby

s(n)

Ada, Matlab

 

s:n

Pliant

s.[n]

F#, OCaml

s

!! n

Haskell

s @ n

Eiffel

s/:n

Rebol

string index s n

Tcl

 

sub

SML

char, aref, schar, svref Common Lisp

GetChar

Modula­3

s

at(n)

Io

at(87)

C++, Smalltalk

aref

Common Lisp

char(s, i)

B

charAt

CoffeeScript, Java, JavaScript

characterAtIndex

Objective­C

n

‐> s.inxGet

Beta

string‐ref

Scheme

StringTake[s, {n}]

Mathematica

$EXTRACT(s, n)

MUMPS

item

Logo

over n chars + c@

Forth

s/.{n}(.).*/\1/

GNU­sed

extract a substringF o r t h s/.{n}(.).*/\1/ G N U ­ s e d

9/16/2016

syntax across languages (One Big Page)

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]

Python

s[n,len]

Ruby

s

n len

Pliant

strndup(s + n, len)

C

substring

Eiffel, Java, Scheme, SML, XPath, YCP

Substring

C#

substr

C++, Perl, Perl6, PHP

SUBSTR

Classic REXX

sub

F#, Lua, OCaml

SUB

Modula­3

subseq

Common Lisp

slice

CoffeeScript, Io, JavaScript

mid$

JavaScript

string range

Tcl

StringTake[s, {n, m}]

Mathematica

strpart(s, n, m)

Yorick

copy/part at s n len

Rebol

copy/part at s n at s m

Rebol

s

copyFrom: n to: m

Smalltalk

(n,m)‐>s.sub

Beta

[s substringWithRange:NSMakeRange(n, len)] Objective­C

SUBSTRING(s FROM n len)

SQL92

$EXTRACT(s, n, m)

MUMPS

sub_string / sub_atom

Prolog

(take len . drop n) s

Haskell

over n chars + len

Forth

s/.{n}(.{len}).*/\1/

GNU­sed

o r t h s/.{n}(.{len}).*/\1/ G N U ­ s e d locate a substring index

locate a substring

index

Ada, Perl, Perl6, Python, Ruby

9/16/2016

syntax across languages (One Big Page)

indexOf CoffeeScript, Java, JavaScript

indexOf

indexOf CoffeeScript, Java, JavaScript

CoffeeScript, Java, JavaScript

 

IndexOf

C#, F#

 

indexOfString

Smalltalk

 

startOf

E

 

search

Common Lisp, Pike, PostScript

 

StringTools[Search]

Maple

 

StringPosition

Mathematica

 

strstr strchr

C

 

find

C++, Logo, Lua, Python, Rebol, YCP

 

findSeq

Io

 

findSubstring

Haskell

 

strfind

Matlab, Yorick

 

strpos

PHP

 

$FIND

MUMPS

 

index_non_blank / find_token Ada

 

substring_index

Eiffel

 

rangeOfString

Objective­C

 

POS

Classic REXX

 

POSITION(needle IN s)

SQL92

 

sub_string / sub_atom

Prolog

 

string first

Tcl

P r o l o g   string first T c l locate a substring (starting

locate a substring (starting at the end)

rindex

OCaml, Perl, Perl6, Python, Ruby

rfind

C++, Python

find/last

Rebol

strrchr

C

index(Going => Backward)

Ada

lastStartOf

E

lastIndexOf

CoffeeScript, Java, JavaScript

last_index_of(88)

Eiffel

LastIndexOf

C#, F#

lastIndexOfString

Smalltalk

string last

Tcl

(search substring string :from‐end t)

Common Lisp

9/16/2016

syntax across languages (One Big Page)

[string rangeOfString:substring options:NSBackwardsSearch] O b j e c t i v e ­ C
[string rangeOfString:substring options:NSBackwardsSearch] O b j e c t i v e ­ C

[string rangeOfString:substring options:NSBackwardsSearch] Objective­C

 

LASTPOS

Classic REXX

 

t=strfind(s,p), t(end)

Matlab

 

strrpos

PHP

 

StringTools[SearchAll](s,p)[‐1]

Maple

  StringTools[SearchAll](s,p)[‐1] M a p l e Booleans type name Bool Haskell, Perl6, Pliant bool

Booleans

type nameStringTools[SearchAll](s,p)[‐1] M a p l e Booleans Bool Haskell, Perl6, Pliant bool C#, C++, C99, F#,

Bool

Haskell, Perl6, Pliant

bool

C#, C++, C99, F#, OCaml, PHP, Python, SML, YAML

Boolean Ada, Lua, Pascal, Smalltalk, Visual Basic

boolean CoffeeScript, Common Lisp, Java, JavaScript, Maple, PHP, YCP

BOOLEAN Eiffel

logic! Rebol

logical Matlab

false valuel logic! R e b o l logical M a t l a b false Ada,

false

Ada, BCPL, Beta, BourneShell, C#, C++, C99, CoffeeScript, E, F#, FL, Forth, Io, Java, JavaScript, Logo, Lua, Maple, Matlab, OCaml, Oz, Pascal, PHP, Pliant, PostScript, Rebol, Ruby, Smalltalk, SML, Tcl, YAML, YCP

False

Eiffel, Haskell, Mathematica, merd, Python, Visual Basic

FALSE

Modula­3, SQL92

false()

XPath

#f

Dylan, Scheme

n

YAML

nil

Common Lisp, Emacs Lisp, Io, Lua, Ruby

no

CoffeeScript, Tcl, YAML

No

Prolog

none

Rebol

None

Python

null

CoffeeScript, JavaScript

NULL

C, C++, C99, PHP

off

CoffeeScript, Tcl, YAML

undef

Perl, Perl6

9/16/2016

syntax across languages (One Big Page)

undefined

CoffeeScript, JavaScript

fail

Prolog

FAIL

Maple

array

 

containing at

Matlab

least one false

value

 

exit status

different from

BourneShell

0

0(89)

Awk, B, C, C++, C99, Classic REXX, CoffeeScript, Forth, JavaScript, Matlab, MUMPS, Perl, Perl6, PHP, Pike, Python, Tcl, Visual Basic, XPath, Yorick

0.0

Matlab, Perl, PHP

NaN

CoffeeScript, 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

Python {} Matlab, Python array() P H P true value TRUE Modula­3, SQL92 True Eiffel,

true value

TRUE

Modula­3, SQL92

True

Eiffel, Haskell, Mathematica, merd, Python, Visual Basic

 

Ada, BCPL, Beta, BourneShell, C#, C++, CoffeeScript, E, F#, FL, Forth, Io, Java,

true

JavaScript, Logo, Maple, OCaml, Oz, Pascal, PHP, Pliant, PostScript, Prolog, Rebol, Ruby, Smalltalk, SML, Tcl, YAML, YCP

true()

XPath

t

Common Lisp, Emacs Lisp

#t

Dylan, Scheme

y

YAML

yes

CoffeeScript, Tcl, YAML

Yes

Prolog

on

CoffeeScript, Tcl, YAML

exit

status 0 BourneShell

anything

Awk, B, C, C++, Common Lisp, Dylan, Emacs Lisp, Matlab, MUMPS, Perl, Perl6, Pike,

not

9/16/2016

syntax across languages (One Big Page)

false

Python, Rebol, Ruby, Scheme, XPath, Yorick

1

Classic REXX, MUMPS

non zero

number

Tcl

non‐

zero‐

Visual Basic

numbers

‐1

Forth

logical notzero‐ Visual Basic numbers ‐1 Forth ! Awk, B, C, C#, C++, CoffeeScript, E, Java, JavaScript,

!

Awk, B, C, C#, C++, CoffeeScript, E, Java, JavaScript, Mathematica, Perl, Perl6, PHP, Pike, Ruby, Tcl, YCP, Yorick

not(90)

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

Not

Oz, Visual Basic

NOT

Modula­3

~

BCPL, Dylan, Matlab, PL/I

^

PL/I

'

MUMPS

\

Classic REXX

=0

Forth

logical or / and' MUMPS \ Classic REXX =0 Forth short circuit | | / & & Awk, C,

short circuit

|| / &&

Awk, C, C#, C++, CoffeeScript, E, F#, Haskell, Java, JavaScript, Mathematica, Matlab, merd, OCaml, Perl, Perl6, PHP, Pike, Ruby, Tcl, YCP, Yorick

|

/ &

B, BCPL, Dylan

or / and

CoffeeScript, Common Lisp, Emacs Lisp, Io, Logo, Lua, Modula­2, Perl, Perl6, PHP, Pliant, Python, Ruby, Scheme, Smalltalk

OR / AND

Modula­3

or / &(91) Modula­2

any / all

Rebol

orelse /

SML

andalso

orelse /

Oz

andthen

or else / and then

Ada, Eiffel

;

/

,

Prolog

9/16/2016

syntax across languages (One Big Page)

&

/

!

MUMPS

non short circuit (always evaluates both arguments)

|

/ &

C#, Classic REXX, Java, Matlab, Smalltalk

or / and

Ada, Beta, Eiffel, Maple, Pascal, PostScript, Rebol, SML, XPath

Or / And(92) Oz, Visual Basic

\/ / /\(14)

BCPL

?| /

Perl6

Bags and Lists

type name\/ / /\ (14) B C P L ?| / Perl6 Bags and Lists seq YAML

seq

YAML

a

list

F#, OCaml, SML

[a]

Haskell

a[]

C#

list

Maple, Python

List

Io, Mathematica, Pliant

Array or List

Perl6

ARRAY or LINKED_LIST

Eiffel

Array or OrderedCollection

Smalltalk

 

ARRAY

Perl

 

array

PHP

cell

Matlab

 

vector

C++

Containers.Vectors.Vector or Ada.Containers.Doubly_Linked_Lists.List Ada

list concatenationor Ada.Containers.Doubly_Linked_Lists.List A d a + E, Eiffel, merd, PHP, Pike, Python, Ruby ,

+

E, Eiffel, merd, PHP, Pike, Python, Ruby

,

Maple, Matlab, Perl, Smalltalk

@

F#, OCaml, SML

&

Ada

++

Haskell

|||

Icon

array_merge

PHP

9/16/2016

syntax across languages (One Big Page)

merge

YCP

concat

CoffeeScript, JavaScript, Tcl

concatenate

Dylan

nconc

Common Lisp, Emacs Lisp

append

Beta, Common Lisp, Emacs Lisp, Prolog, Rebol, Scheme

Append

Oz

appendSeq

Io

arrayByAddingObjectsFromArray Objective­C

sentence

Logo

Join

Mathematica

list flattening­ C sentence L o g o Join Mathematica one level depth concat F#, Haskell, Mercury,

one level depth

concat

F#, Haskell, Mercury, SML

flatten

F#, Io, merd, OCaml, Prolog, YCP

Flatten

Oz

eval concat

Tcl

ListTools[FlattenOnce] Maple

 

{*}$l

Tcl8.5

"$l"

FishShell

recursive

flatten

Pike, Ruby

ListTools[Flatten] Maple

 

Flatten

Mathematica

list constructorM a p l e   Flatten Mathematica [ a, b, c ] (93) CoffeeScript, E,

[

a, b, c ](93)

CoffeeScript, E, Haskell, JavaScript, Maple, Matlab, merd, Perl, Perl6, PHP5, PostScript, Prolog, Python, Ruby, SML, YAML, YCP

(

a,

b,

c

)

Perl, Perl6

{

a, b, c }(94)

C, C++, Lua, Mathematica

#(a, b, c)

 

Dylan

#(a b c)(95)

 

Smalltalk

{

a. b. c }

 

Squeak

[

a

;

b

;

c

]

F#, OCaml

[

a

b

c

]

Logo, Oz, Rebol

9/16/2016

syntax across languages (One Big Page)

({ a, b, c })

Pike

'(a b c)

Common Lisp, Emacs Lisp, Scheme

<< a, b, c >>

Eiffel

list(a, b, c)

Io

list

Common Lisp, Dylan, Emacs Lisp, Scheme, Tcl

array(a, b, c)

PHP

new t[] { a, b, c }

C#

new[] { a, b, c }

C#3

new List<t> { a, b, c}

C#3

Array(a, b, c)(96)

JavaScript

[NSArray arrayWithObjects:a, b, c, nil]

Objective­C

set l a b c

FishShell

‐ a

‐ b

YAML

‐ c

l a b c FishShell ‐ a ‐ b YAML ‐ c list/array indexing a[i] B,

list/array indexing

a[i]

B, BourneShell, C, C#, C++, CoffeeScript, Dylan, E, FishShell, Java, JavaScript, KornShell, Lua, Maple, merd, Modula­3, MSH, Pascal, Perl, Perl6, PHP, Pike, Python, Ruby

a*[i] or a!i or a*(i) depending on the

BCPL

version

a[[i]]

Mathematica

a[i]:default

YCP

a(i)

Ada, Matlab

a:i

Pliant

a/:i

Rebol

a.(i)

F#, OCaml

a.[i]

F#

a

!! i

Haskell, Mercury

a @ i

Eiffel

a i get(97)

PostScript

a at(i)

Io

at(98)

C++, Smalltalk

lindex

Tcl

nth

Common Lisp, Emacs Lisp, OCaml

9/16/2016

syntax across languages (One Big Page)

Nth

Oz

aref

Common Lisp, Emacs Lisp

nth0 / nth1

Prolog

list‐ref / vector‐ref Scheme

element

Dylan

slice

Ruby

node[i]

XPath

objectAtIndex

Objective­C

item

Logo

a i cells + @ (for write access: o a i cells + !

Forth

a i cells + @ (for write access: o a i cells + ! Forth adding

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

cons

Common Lisp, Emacs Lisp, Scheme

pair

Dylan

fput

Logo

Prepend Ada, Mathematica

side­effect

unshift

CoffeeScript, JavaScript, Perl, Perl6, Ruby

prepend

YCP

push_front

C++

addFirst

Smalltalk

insert

Rebol

put_first

Eiffel

push

Common Lisp, Io

array_unshift PHP

PrependTo

Mathematica

9/16/2016

syntax across languages (One Big Page)

adding an element at index9/16/2016 syntax across languages (One Big Page) return the new list (no side­effect) linsert l i

return the new list (no side­effect)

linsert l i e Tcl

Insert

Ada, Mathematica

side­effect

[a

insertObject:e atIndex:i]

Objective­C

a.insert(i, e)

Python, Ruby

a insertAt(e, i)

Io

a add: e beforeIndex: i / a add: e afterIndex: i Smalltalk

splice(@a, $i, 0, $e)

Perl

adding an element at the enda l l t a l k splice(@a, $i, 0, $e) P e r l return

return the new list (no side­effect)

[l

e]

Matlab

push

merd

arrayByAddingObject Objective­C

lput

Logo

linsert l end e

Tcl

Append

Ada, Mathematica

side­effect

push

CoffeeScript, JavaScript, Perl, Perl6, Ruby

push_back C++

append

Io, Pliant, Python, Rebol

AppendTo Mathematica

lappend

Tcl

+=

Pliant

add

Java, Smalltalk, YCP

put_last

Eiffel

array_push PHP

addObject Objective­C

first elemente l array_push P H P addObject Objective­C head Haskell Head F # hd  

head

Haskell

Head

F#

hd

 

9/16/2016

syntax across languages (One Big Page)

 

F#, OCaml

car

Common Lisp, Emacs Lisp, Scheme

first

Eiffel, Io, Logo, Pliant, Rebol, Smalltalk

First(99)

Mathematica

First_Element Ada

iterator head Beta begin C++ First Ada
iterator
head
Beta
begin C++
First Ada

all but the first elementA d a iterator head Beta begin C++ First Ada tail Haskell Tail F # tl

tail

Haskell

Tail

F#

tl

F#, OCaml

cdr

Common Lisp, Emacs Lisp, Scheme

Rest

Mathematica

butfirst

Logo

allButFirst

Smalltalk

l[1:]

Python

a(2:end)

Matlab

L = [_|ButFirst] Prolog

lrange l 1 end

Tcl

last elementP r o l o g lrange l 1 end T c l last E, Eiffel,

last

E, Eiffel, Haskell, Io, Logo, Pliant, Prolog, Rebol, Scheme, Smalltalk

Last

Mathematica, Oz

lastObject

Objective­C

a[‐1]

Perl, Pike, Python, Ruby

a(end)

Matlab

node[last()]

XPath

(car (last l)) Common Lisp, Emacs Lisp

lindex l end

Tcl

Last_Element

Ada

iterator

l end T c l Last_Element A d a iterator

9/16/2016

syntax across languages (One Big Page)

Last Ada all but the last element
Last
Ada
all but the last element

Most Mathematica

get the first element and remove itPage) Last Ada all but the last element Most Mathematica shift CoffeeScript, JavaScript, Perl, Perl6, Ruby

shift

CoffeeScript, JavaScript, Perl, Perl6, Ruby

shift!

merd

pop

Common Lisp, Logo

removeFirst Io, Smalltalk

array_shift PHP

get the last element and remove itLogo removeFirst Io, Smalltalk array_shift P H P pop CoffeeScript, E, Io, JavaScript, Perl, Perl6, Python,

pop

CoffeeScript, E, Io, JavaScript, Perl, Perl6, Python, Ruby

pop!

merd

array_pop PHP

removeLast Io, Smalltalk

dequeue

Logo

for each element do somethingP removeLast Io, Smalltalk dequeue L o g o each merd, Pliant, Ruby for v in

each

merd, Pliant, Ruby

for v in l

CoffeeScript, E, Maple, Ruby

for v in l:

Python

for v in l; do

;

done

BourneShell

for v in l do

F#

for v in l;

;

end

FishShell

for (v in l)

Awk, Dylan

for (var v in l) {

}

JavaScript

For Each v in l

Next

Visual Basic

for v in range loop

end loop

Ada

for

Perl

foreach

Logo, Lua, Perl, PHP, Pike, Rebol, Tcl

foreach (t v in l)

 

C#

foreach (v in l)

 

C#3

foreach ($v in l)

 

MSH

9/16/2016

syntax across languages (One Big Page)

foreach(t v, l, {

 

})

YCP

l foreach(v,

)

Io

for_each

C++

for‐each

Scheme

forall

PostScript, Prolog

ForAll

Oz

iter

F#, OCaml

do

Smalltalk

do_all

Eiffel

app

SML

mapc

Emacs Lisp

mapM_

Haskell

Scan

Mathematica

(dolist (v l)

)

(loop for v in l do

)

mapc Common Lisp

list.iterate (# do current

#)

Beta

l.Iterate(

)

F#

Iterate

Ada

B e t a l.Iterate( ) F# Iterate A d a transform a list (or bag)

transform a list (or bag) in another one

map

Dylan, F#, Haskell, Io, Maple, Mercury, merd, OCaml, Perl, Pike, Python, Ruby, Scheme, SML

Map

F#, Mathematica, Oz

mapcar

Common Lisp, Emacs Lisp

maplist

Prolog, YCP

sublist

Prolog

map / map.se

Logo

for‐each

XSLT

foreach or selected

MSH

collect

Ruby, Smalltalk

transform

C++

array_map

PHP

/@

Mathematica

[

f x | x <‐ l ](100)

Haskell

[

f(x) for x in l ](100)

Python

magical: sin(x) computes sin on each element

Matlab

9/16/2016

syntax across languages (One Big Page)

transform two lists in parallel9/16/2016 syntax across languages (One Big Page) map2 F#, OCaml zipWith Haskell Zip Maple, Oz m

map2

F#, OCaml

zipWith

Haskell

Zip

Maple, Oz

map

Dylan, Logo, Python, Scheme

map.se

Logo

mapcar

Common Lisp

maplist2

Prolog

l1 with: l2 collect:

Smalltalk

transform

C++

ListPair.map

SML

magical: a binary function or operator is appliied on each element

Matlab

find an elementfunction or operator is appliied on each element Matlab f i n d C++, Common Lisp,

find

C++, Common Lisp, F#, Haskell, merd, OCaml, Rebol, Ruby, Scheme­SRFI1, SML, YCP

Find

Ada

find_if

C++

find‐if

Common Lisp

first(21)

Perl

detect

Ruby, Smalltalk

search

Pike

ListTools[Search]

Maple

lsearch ‐exact

Tcl

index

Python

indexOf

Io

indexOfObject,

Objective­C

indexOfObjectIdenticalTo

find(a == 3)

Matlab

Position

Mathematica

keep elements== 3) M a t l a b Position Mathematica matching find_all F#, OCaml, Ruby  

matching

find_all

F#, OCaml, Ruby

 

F#, Haskell, Mercury, merd, OCaml, Pike, Python, Scheme­SRFI1,

9/16/2016

syntax across languages (One Big Page)

filter

SML, YCP

filter!

Scheme­SRFI1

Filter

Oz

grep

Perl, Perl6

where

MSH

select

Io, Maple, Ruby, Smalltalk

Select / Case

Mathematica

selectInPlace

Io

remove‐if‐not delete‐if‐ not

Common Lisp

choose

Dylan

array_filter

PHP5

[

x | x <‐ l, p x ](100)

Haskell

[

x for x in l if p(x) ]

Python

(100)

a(a == 3)

Matlab

non matching

remove‐if delete‐if Common Lisp

reject

Ruby

partition a list: elements matching, elements non matchingC o m m o n L i s p reject R u b y partition

partition F#, Haskell, merd, OCaml, Ruby, Scheme­SRFI1, SML

partition! Scheme­SRFI1

Partition Oz

split a listSML partition! Scheme­SRFI1 Partition O z in 2 based on a predicate break Haskell span Haskell

in 2 based on a predicate

break Haskell span Haskell
break Haskell
span Haskell

into sublists delimited by elements matching a predicate

split‐sequence(101) Common Lisp

ListTools[Split]

Maple

into a list of lists of same value

group Haskell Split Mathematica
group Haskell
Split Mathematica

9/16/2016

syntax across languages (One Big Page)

into sublists based on a predicate

groupBy Haskell Split Mathematica
groupBy Haskell
Split Mathematica

is an element in the listbased on a predicate groupBy Haskell Split Mathematica member? Dylan, merd, Ruby include? R u b

member?

Dylan, merd, Ruby

include?

Ruby

mem

F#, OCaml

member

Common Lisp, Prolog, Scheme

Member

Oz

MemberQ

Mathematica

memq memv

Scheme

memberp / member? Logo

contains

E, Io, YCP

containsObject

Objective­C

in

CoffeeScript, JavaScript, Python, SQL92, Tcl8.5

in_array

PHP

includes

Smalltalk

elem

Haskell, Mercury

has

Eiffel

has_value

Pike

ismember

Matlab

/elt/

GNU­sed

is the predicate true for an elemente ismember M a t l a b /elt/ GNU­sed any (30) Haskell, Matlab, Mercury, Python,

any(30)

Haskell, Matlab, Mercury, Python, Scheme­SRFI1

any?

Dylan, Ruby

anySatisfy Smalltalk

exists

F#, OCaml, SML

exists?

merd

some

Common Lisp

Some

Oz

ormap

Maple

detect

Io

is the predicate true for every elementLisp Some O z ormap Maple detect I o

9/16/2016

syntax across languages (One Big Page)

all(30)

Haskell, Mercury, Python, SML

All

Oz

all?

merd, Ruby

allSatisfy Smalltalk

every

Common Lisp, Scheme­SRFI1

every?

Dylan

for_all

F#, OCaml

andmap

Maple

smallest / biggest elementa n for_all F#, OCaml andmap M a p l e min / max Common Lisp,

min / max

Common Lisp, Eiffel, Io, Java, Maple, Matlab, Perl6, PHP5, Pike, Prolog, Python, Ruby, Scheme, Smalltalk

Min / Max

Mathematica

minimum / maximum Haskell, Mercury, merd

minimum‐of /

Rebol

maximum‐of

min minstr / max

Perl

maxstr(21)

min_element /

C++

max_element

join a list of strings in a string using a glue stringmaxstr (21) min_element / C++ max_element join(s, l) Perl, Perl6, PHP String.Join(s, l) C #

join(s, l)

Perl, Perl6, PHP

String.Join(s, l)

C#

s.join(l)

Python

l.join(s)

CoffeeScript, JavaScript, Perl6, Ruby

l

asStringWith: s

Smalltalk

join l s

Tcl

implode(s, l)

PHP

ListTools[Join]

Maple

rjoin

E

join

Io

concat

F#, OCaml

strcat

Matlab

concat_atom

Prolog

l

* s

Pike, Ruby

(mapconcat 'identity l s) Emacs Lisp

9/16/2016

syntax across languages (One Big Page)

componentsJoinedByString

Objective­C

intercalate

Haskell

StringJoin @@ Riffle[l, s] Mathematica

list sizeStringJoin @@ Riffle[l, s] M a t h e m a t i c a size

size

C++, Dylan, E, Io, Java, Matlab, merd, Pliant, Ruby, Scilab, Smalltalk, YCP

 

sizeof Pike

length

C#, CoffeeScript, Common Lisp, Emacs Lisp, F#, Haskell, Java, JavaScript, Matlab, Mercury, OCaml, PostScript, Prolog, Ruby, Scheme, SML

Length Ada, F#, Mathematica, Oz

 

length? Rebol

len

Python

llength Tcl

$LENGTH MUMPS

elems

Perl6

getn

Lua

count Eiffel, FishShell, Objective­C, PHP, SQL92, XPath

numel

Matlab

scalar

@l

Perl

nops

Maple

#

Lua

iterate with indexscalar @l Perl nops Maple # Lua each_with_index m e r d , R u b

each_with_index

merd, Ruby

enumerate(l)

Python

foreach($l as $i => $v)

 

PHP

a foreach(i, e,

)

Io

for i => v in l

E

for (v in l, i from 0)

end

Dylan

forAllInd

Oz

foreachi

Lua

foreach(l; typ0 i; typ1 v) {

}

Pike

withIndexDo

Squeak

iteri

F#, OCaml

IterateIndexed

F#

9/16/2016

syntax across languages (One Big Page)

MapIndexed

Mathematica

(loop for v in l as i upfrom 0 do

)

Common Lisp

for v,i in l

CoffeeScript

remove duplicates0 do ) Common Lisp for v,i in l CoffeeScript uniq merd, Perl6, Pike, Ruby uniq!

uniq

merd, Perl6, Pike, Ruby

uniq!

Ruby

uniq2

Pike

unique(102)

C++, Io, Matlab, Rebol

nub

Haskell

array_unique

PHP

ListTools[MakeUnique] Maple

delete‐duplicates

Common Lisp, Scheme­SRFI1

delete‐duplicates!

Scheme­SRFI1

remove‐duplicates

Common Lisp, Dylan

lsort ‐unique

Tcl

toset

YCP

distinct

SQL92

set

Python

Union

Mathematica

sortS Q L 9 2 set Python Union Mathematica sort (103) C#, C++, CoffeeScript, Common Lisp,

sort(103)

C#, C++, CoffeeScript, Common Lisp, E, Eiffel, F#, Haskell, Io, Java, JavaScript, Lua, Maple, Matlab, merd, OCaml, Perl, Perl6, PHP, Pike, Prolog, Python, Rebol, Ruby, Scheme, XSLT, YCP

sort!

Ruby

sorted

Python

Sort

Mathematica, Oz

sort_by

merd, Ruby

sortBy

Haskell, Io, Smalltalk

order by

SQL92

lsort

Tcl

asort

Awk

sort‐object

MSH

sortedArrayUsingSelector,

Objective­C

sortUsingSelector

9/16/2016

syntax across languages (One Big Page)

predsort / keysort / mergesort

Prolog

reverse(One Big Page) predsort / keysort / mergesort Prolog reverse C++, CoffeeScript, Common Lisp, Dylan, Emacs

reverse

C++, CoffeeScript, Common Lisp, Dylan, Emacs Lisp, Haskell, Io, Java, JavaScript, Logo, Mercury, merd, Perl, Perl6, Pike, Prolog, Python, Rebol, Ruby, Scheme

Reverse

C#, Mathematica, Oz

reversed

Python, Smalltalk

reverse_copy

C++

rev

F#, OCaml, SML

Reverse_Elements

Ada

lreverse

Tcl8.5

array_reverse

PHP

ListTools[Reverse] Maple

fliplr flipud

Matlab

l[::‐1]

Python

list of couples from 2 listsfliplr flipud Matlab l[::‐1] P y t h o n combine F#, OCaml zip F#, Haskell,

combine

F#, OCaml

zip

F#, Haskell, Maple, merd, Perl6, Python, Ruby, Scheme­SRFI1, SML

pairlis(104) Common Lisp

transpose

Ruby

Transpose

Mathematica

[a b]

Matlab

2 lists from a list of couplesR u b y Transpose Mathematica [a b] Matlab split F#, OCaml unzip F#, Haskell, merd,

split

F#, OCaml

unzip

F#, Haskell, merd, SML

unzip2

Scheme­SRFI1

transpose

Ruby

Transpose

Mathematica

zip(*l)

Python

a(1,:), a(2,:) Matlab

lookup an element in a association listP y t h o n a(1,:), a(2,:) M a t l a b

M a t l a b lookup an element in a association list
M a t l a b lookup an element in a association list

9/16/2016

syntax across languages (One Big Page)

lookup

Haskell

assoc

Common Lisp, Emacs Lisp, F#, OCaml, Ruby, Scheme

assq

Emacs Lisp, Scheme

assv

Scheme

get_assoc Prolog

select

Rebol

a.(e)

Matlab

a[e]

Maple

gprop

Logo

/.

Mathematica

list out of a baga[e] Maple gprop L o g o /. Mathematica   to_a Ruby toArray J a v

 

to_a

Ruby

toArray

Java

asArray

Smalltalk

to_list

merd

list

Python

map‐as(<list>, bag) Dylan

[a.(:)]

Matlab

array get

Tcl

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

,

en)

foldl

Haskell, Maple, Mercury, merd, SML

FoldL

Oz

fold_left

OCaml

fold

F#, Scheme­SRFI1

Fold

Mathematica

reduce(105) Common Lisp, Dylan, Io, Perl, Perl6, Pike, Python

inject

Ruby

inject into Smalltalk

R u b y inject into S m a l l t a l k f(e1,

f(e1, f(e2,

f(en, init) ))

foldr

Haskell, Maple, Mercury, merd, SML

FoldR

Oz

9/16/2016

syntax across languages (One Big Page)

fold‐right

Scheme­SRFI1

fold_right

OCaml

foldBack

F#

rreduce

Pike

(reduce f '(e1 e2 init)

en) :from‐right t :initial‐value

Common Lisp

reverseReduce

Io

Various Data Types

tuple typeCommon Lisp reverseReduce I o Various Data Types typ1 * * typn F # , O

typ1 *

* typn

F#, OCaml, SML

(typ1,

,

typn)

Haskell

typ1,

,

typn

merd

tuple

Python

tuple!

Rebol

Tuple[Typ1, Typ2, Typ3] E

tuple< typ1,

,

typn > C++­0x

tuple constructorTyp3] E tuple< typ1, , typn > C++­0x a, b, c   F#, Lua, merd, OCaml,

a, b, c

 

F#, 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

.

c

Rebol

(cons a b) Common Lisp

computable tuple (these are a kind of immutable lists playing a special role in parameter passing)a . b . c Rebol (cons a b) Common Lisp empty tuple () merd, Perl,

empty tuple

()

merd, Perl, Perl6, Python

[]

Ruby

{}

Matlab, Smalltalk

#()

Smalltalk

Nothing Prolog

9/16/2016

syntax across languages (One Big Page)

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

t

merd, Perl

*t

Python, Ruby

t{:}

Matlab

f

@@ t

Mathematica

L

=

[ F | Args ], call(L) Prolog

L = [ F | Args ], call(L) P r o l o g reference (pointer)

reference (pointer)

creation

&

B, C, C#, C++

\

Perl

AddressOf

Visual Basic

addr(106) Pascal

@(106)

Pascal

lv

BCPL

ref

C#, F#, OCaml, SML

newSTRef

Haskell

NewCell

Oz

variable

Forth

'access

Ada

:> :>>

Pliant

''

Maple

dereference

*(107)

B, C, C#, C++

$

@ % &(107)

 

Perl

‐>[

]

‐>{

}

‐>(

)(108)

Perl

‐>(109)

 

C, C++

^(108)

Modula­3, Pascal

9/16/2016

syntax across languages (One Big Page)

! (107) F#, OCaml, SML

!(107)

! (107) F#, OCaml, SML

F#, OCaml, SML

 

rv

BCPL

 

readSTRef

Haskell

 

Access

Oz

 

.[all]

Ada

 

@

Forth

 

eval

Maple

 

(reg)

Assembler

assigning (when dereferencing doesn't give a lvalue)

writeSTRef Haskell

Assign

Oz

:=

F#, OCaml, SML

!

Forth

Assign O z := F#, OCaml, SML ! Forth optional value null value 0 (110) C++,

optional value

null value

0(110)

C++, Forth

0 nullptr(110)

C++­0x

NULL

C, Maple, SQL92

nil

Common Lisp, Emacs Lisp, Io, Lua, Objective­C, Ruby, Smalltalk

null

C#, CoffeeScript, Java, JavaScript

Null(111)

Ada, Mathematica

undef

Perl

None

F#, OCaml, Python

NONE

SML

Nothing

Haskell

Void

Eiffel

#f ()

Emacs Lisp

(empty) / ~ / null YAML

value

 

Ada, C#, CoffeeScript, Common Lisp, Eiffel, Emacs Lisp, Java, JavaScript, Lua, Perl, Perl,

v

Python, Ruby, Scheme, Smalltalk

*v(110) C, C++

Just v Haskell

Some v F#, OCaml

9/16/2016

syntax across languages (One Big Page)

SOME v S M L

SOME v

SOME v S M L

SML

type name

option F#, OCaml, SML

Maybe Haskell

null coalescing

COALESCE SQL92

?:

PHP

||

JavaScript, Perl, Ruby

//(112) Perl

??

C#

if(a, b) Visual Basic

or

Python, Scheme

?? C# if(a, b) Visual Basic or Python, Scheme record type declaration struct { typ1 n1;

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;

Ada

end record;

selector

 

Ada, Beta, C, C#, C++, CoffeeScript, E, Eiffel, F#, Java, JavaScript, Lua, Matlab,

.

Modula­2, Modula­3, OCaml, Oz, Pascal, Python, Ruby

::

XPath

%

Fortran90

'(113)

Ada

^

Mercury

r { field }

merd

r:field

Pliant

field r

Haskell

‐>

C, C++

r[field]

Maple

r["field"] JavaScript

9/16/2016

syntax across languages (One Big Page)

#field r

SML

normal

function

Common Lisp, Dylan, Haskell, Io, Smalltalk

call

union type declarationCommon Lisp, Dylan, Haskell, Io, Smalltalk call union { typ1 n1; typ2 n2; } C ,

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 =>

Ada

when others =>

end case;

end record;

enumerated type declarationAda when others => end case; end record;   enum typ { n1; n2; } (114)

 

enum typ { n1; n2;

}(114) C, C#, C++, Java

Enum typ

 

n1

Visual Basic

 

n2

End Enum

 

(n1, n2,

)

Pascal

type typ is(115)

 

Ada

data Typ = N1 | N2 |

 

Haskell

type typ = N1 | N2 |

 

OCaml

datatype typ = N1 | N2 |

 

SML

dictionary 

 
 

type name

map

YAML

 

Map

F#, Io

std::map

C++

dict

Python

Dictionary

Pliant, Smalltalk

Hash

Perl6, Ruby

HASH

Perl

9/16/2016

syntax across languages (One Big Page)

HASH_TABLE

Eiffel

HashTable

Java

Hashtbl

F#

Hashtbl.t

OCaml

struct

Matlab

table

Maple

array

PHP

Data.Map, Data.HashTable

Haskell

Containers.Ordered_Maps.Map Ada

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, 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 end

Dylan

dict create a b c d

 

Tcl8.5

new t { {a, b}, {c, d} }

C#

fromList

 

Haskell

[NSDictionary dictionaryWithObjectsAndKeys:b, a, d, c, nil]

Objective­C

 

b

 

9/16/2016

syntax across languages (One Big Page)

a:

c: d

YAML

access: read/write

h[k]

Awk, C#, C++, CoffeeScript, Dylan, E, JavaScript, Lua, Maple, MSH, PHP, Python, Ruby

$h{k}

Perl

%h{k} or

Perl6

%h<s>

h(k)

Tcl

h.[k]

F#

h.k

CoffeeScript, JavaScript, Lua, Matlab

h:k

Pliant

h["k"] or h‐

Pike

>k

(gethash k h) Common Lisp

access: read

h

k get

PostScript

 

find

F#, OCaml

 

fetch

Ruby

get

Java

dict get

Tcl8.5

at

Io, Smalltalk

h@k or h.at(k)

Eiffel

h[k]:default

YCP

${h[k]}

KornShell

h.get(k, returned_value_when_k_unfound) Python

objectForKey

Objective­C

lookup

Haskell

Element

Ada

access: write

h

k o put

PostScript

put

Eiffel, Java

add, replace

F#, OCaml

store

Ruby

dict set

Tcl8.5

h[k]

KornShell, YCP

9/16/2016

syntax across languages (One Big Page)

atPut

Io

h

at: k put: o

Smalltalk

[h setObject:o forKey:k] Objective­C

insert

Haskell

Replace_Element

Ada

has the key ?

exists $h{k}

Perl

exists

Perl6, Pliant

dict exists

Tcl8.5

has

Eiffel

haskey

YCP

hasKey

Io

has_key

Python

has_key?, include?, key?, member?

Ruby

Contains

Ada, C#, F#

containsKey

Java

includesKey

Smalltalk

k

in h

CoffeeScript, JavaScript, Python

k

not in h

Python

in

Awk

mem

F#, OCaml

member

Haskell

isfield

Matlab

find(116)

C++

 

h[k]

Pike

(gethash k h)

Common Lisp

 

maps

E

 

known

PostScript

isset(h[k]), array_key_exists(k, h) PHP

remove by key

delete $h{k}

Perl

del h[k]

Python

unset(h[k])

PHP

remove

Eiffel, F#, Java, OCaml, YCP

9/16/2016

syntax across languages (One Big Page)

Remove

C#, F#

dict remove

Tcl8.5

removeAt

Io

removeKey

E, Smalltalk

remhash

Common Lisp

delete

CoffeeScript, Haskell, JavaScript, Perl6, Ruby

Delete

Ada

erase

C++

m_delete

Pike

removeObjectForKey Objective­C

undef

PostScript

rmfield

Matlab

list of keys

keys

Haskell, Io, Maple, MSH, Perl, Perl6, Python, Ruby, Smalltalk

dict keys

Tcl8.5

keySet

Java

allKeys

Objective­C

AllKeys

C#

indices

Pike

current_keys

Eiffel

getKeys

E

array_keys

PHP

fieldnames

Matlab

findall(Key, item(Key, _), Keys) Prolog

${!h[@]}

KornShell

list of values

values

Io, Java, Perl, Perl6, Pike, Python, Ruby, Smalltalk

dict values Tcl8.5

getValues

E

content

Eiffel

array_values PHP

struct2cell Matlab

entries

Maple

elems

Haskell

9/16/2016

syntax across languages (One Big Page)

${h[@]}

KornShell

merge

merge(117)

Ruby

array_merge(117) PHP

union(118)

Haskell

update(117)

Python, Ruby

putAll(117)

Java

insert(118)

C++

(%h1, %h2)(117) Perl

insert (118) C + + (%h1, %h2) (117) P e r l range inclusive inclusive a

range

inclusive

inclusive

a

b

Ada, E, merd, MSH, Pascal, Perl, Ruby

a:b

 

Matlab

[

a

b

]

CoffeeScript, F#, Haskell

to

Io, Smalltalk

seq a b / jot ‐ a b(119)

BourneShell, FishShell

{a

b}

KornShell

range

 

PHP

range(from: a, to: b, by: step) Dylan

Range

 

Mathematica

Range with

 

Io

List.number A B Step

Oz

numlist / between

Prolog

iseq

 

Logo

inclusive exclusive

a b CoffeeScript, Ruby

a !

b E

range

Python

a b CoffeeScript, Ruby a ! b E range Python Mathematics type name integers short, int,

Mathematics

type nameRuby a ! b E range Python Mathematics integers short, int, long

integers

short, int, long

short, int, long

9/16/2016

syntax across languages (One Big Page)

 

C, C#

int

OCaml, PHP, SML, YAML

Int

Perl6

Int, uInt, Int8, Int16

Pliant

int, long(120)

Python

integer

Maple, PHP

INTEGER, INT, SMALLINT

SQL92

INTEGER, INTEGER_8, NATURAL_8

 

Eiffel

int8, uint8, int16, uint16,

64

Matlab

int8_t, uint8_t, int16_t, uint16_t,

64

C99

int, int8, uint8, int16, uint16, int32, uint32, int64, uint64, bigint, bignum

F#

Int, Integer, Int8, Int16, Int32, Int64

 

Haskell

Integer, FixNum, BigNum

Ruby

Integer, SmallInteger, LargeInteger

 

Smalltalk

Integer

Mathematica

type T is range Low

High;

Ada

floating point

float, double, long double

C

float, double

C#

float

Maple, OCaml, PHP, SML, YAML

Float

Ruby

float, float32

F#

Float, Float32, Float64

Pliant

NUMERIC, DECIMAL, DOUBLE PRECISION

SQL92

Rat

Perl6

DOUBLE, REAL

Eiffel

single, double

Matlab

Float, Double, Ratio

Haskell

Float, Double, Fraction, FixedPoint

Smalltalk

float, decimal.Decimal

Python

Real, Rational

Mathematica

Number

Io

type T is digits N range Low High;

Ada

9/16/2016

syntax across languages (One Big Page)

type T is delta S digits N range Low

High;(121)

Ada

type T is delta S digits N range Low High; (121) Ada numbers syntax integers  

numbers syntax

integers

 

Awk, B, BourneShell, C, C#, C++, CoffeeScript, E, Eiffel, F#, Forth, Haskell, Io, Java,

1000

JavaScript, Logo, Maple, Mathematica, merd, OCaml, Oz, Pascal, Perl, Perl6, PHP, Pike, Pliant, Prolog, Python, Rebol, Ruby, Scheme, Smalltalk, SQL92, Tcl, Yorick

1000,

Common Lisp, Emacs Lisp

1000.

1000,

1000.,

Awk, Matlab

1000.0

1000,

'1000'D Classic REXX

1000,

Ada

1E3

integers in base 2, octal and hexadecimal

0b1, 07, 0xf(122) CoffeeScript, Oz, Perl, PHP5, Pike, Ruby

0b1, 0o7, 0xf

F#, OCaml, Perl6

07, 0xf

Awk, C, C++, JavaScript, Python, Tcl

0xf

C#, E, Io, Yorick

07

B

0o7, 0xf

Haskell

1b

Eiffel

2#1#, 8#7#, 16#f# Ada

2#{1}, #{F}

Rebol

#b1, #o7, #xf

Common Lisp, Emacs Lisp, Scheme

2^^1, 8^^7, 16^^f Mathematica

2r1, 8r7, 16rf

Smalltalk

#2r1, #8r7, #16rf Common Lisp, Emacs Lisp

1b, Fh

Pliant

'1'B, 'F'X

Classic REXX

B'1', X'F'

SQL92

$f

Forth

integer thousand­separator

1_000, 10_00, 100_0 Ada, E, Eiffel, OCaml, Perl, Perl6, Ruby

1'000, 10'00, 100'0 Rebol

1_000

merd

9/16/2016

syntax across languages (One Big Page)

floating point

1000., 1E3

C, C++, Classic REXX, CoffeeScript, E, F#, Java, JavaScript, Logo, Maple, OCaml, Python, Scheme, SQL92, Tcl

1000., 1E3, 1,0 Rebol

1000., 1.E3

Eiffel, Oz

1000.0, 1E3

C#, Common Lisp, Emacs Lisp, PHP, Pike, Prolog, Ruby, Smalltalk

1000.0, 1.0E3

Ada, Haskell

1000, 1000.0,

Awk, merd, Perl, Perl6

1E3(123)

1000., 1*^3,

Mathematica

1000`

1000e, 1e3

Forth

addition / subtraction / multiplication / divisionMathematica 1000` 1000e, 1e3 F o r t h   BourneShell, C, C#, C++, Classic REXX,

 

BourneShell, C, C#, C++, Classic REXX, CoffeeScript, Common Lisp, Eiffel, Emacs

+

/

/

/

* /

Lisp, F#, Forth, Haskell, Io, Java, JavaScript, Logo, Maple, Matlab, merd, MUMPS, Perl, Perl6, PHP, Pliant, Prolog, Python, Ruby, Scheme, Smalltalk, SQL92, Tcl, Yorick

‐ nothing / /

+

/

/ * or

Mathematica

+ +. /

‐ ‐.

 

/ * *.

/ /

OCaml

/.(124)

sum /

   

difference /

Logo

product /

quotient

 

add / sub / mul / idiv

PostScript

div

 

f+ / f‐ / f*

Forth

/

f/

exponentiation (power)div   f+ / f‐ / f* Forth / f/ * * Ada, Classic REXX, E,

**

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

*(125)

APL

**, ^

Maple

**, ^ and

Haskell

^^(126)

f**

Forth

pow

C, C++, CoffeeScript, Java, JavaScript, PHP, Pike, Python, SML, Tcl

Pow

C#, Oz

9/16/2016

syntax across languages (One Big Page)

power

Delphi­Kylix, Logo, Rebol

exp

PostScript

expt

Common Lisp, Emacs Lisp, Scheme

raisedTo

Smalltalk

negationCommon Lisp, Emacs Lisp, Scheme raisedTo Smalltalk   Ada, Awk, B, BCPL, BourneShell, C, C#, C++,

 

Ada, Awk, B, BCPL, BourneShell, C, C#, C++, Classic REXX, CoffeeScript, Common Lisp,

E, Eiffel, Emacs Lisp, F#, Haskell, Io, Java, JavaScript, Logo, Maple, Mathematica, Matlab,

merd, MUMPS, Perl, Perl6, PHP, Pike, Pliant, Prolog, Python, Rebol, Ruby, Scheme, Smalltalk, Tcl, Yorick

‐ ‐.

OCaml

~

Oz, SML

neg

PostScript

negate Forth, Rebol

fnegate Forth

minus

Logo

randomRebol fnegate F o r t h minus L o g o random number rand C,

random number

rand

C, Maple, Matlab, Perl, Perl6, PHP, Ruby, Tcl

random

Common Lisp, Logo, Prolog, Python, Yorick

$RANDOM

MUMPS

randomR

Haskell

Random(127)

Ada

Random.int

OCaml

Random, RandomReal, RandomInteger Mathematica

Random value

Io

Random new nextInteger

Smalltalk

r: RANDOM

 

create r.make

Eiffel

r.start

r.item

 

Random ran = new Random(); ran.Next( );

C#

let r = System.Random() r.Next()

F#

mt_rand

PHP

seed the pseudo random generator

srand

C, Perl, Perl6, PHP, Ruby, Tcl

9/16/2016

syntax across languages (One Big Page)

set_seed

Eiffel

random.seed

Python

Random setSeed

Io

Random.init, Random.self_init

OCaml

rand('state',

)

Matlab

rerandom

Logo

RandomTools[MersenneTwister][SetState] Maple

Random new setSeed

Smalltalk

SeedRandom

Mathematica

mkStdGen

Haskell

make‐random‐state

Common Lisp

Reset

Ada

operator priorities and associativitiesC o m m o n L i s p Reset A d a addition vs

addition vs multiplication

mathematical BourneShell, C, C#, C++, Classic REXX, Eiffel, F#, Haskell, Io, Java, Maple, Mathematica, Matlab, merd, Perl, Perl6, PHP, Python, Ruby, Tcl, Yorick

same

priorities MUMPS, Smalltalk

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

mathematical

Classic REXX, Eiffel, Haskell, Io, Maple, Mathematica, Matlab, Perl, Perl6, Python, Ruby

negation

F#, OCaml

first

square root / e­exponential / absolute valuePerl6, Python, Ruby negation F#, OCaml first sqrt / exp / abs Ada, C, C++, CoffeeScript,

sqrt / exp / abs

Ada, 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

Matlab

/

exp / abs

sqrt / exp /

Awk, Logo

Sqrt / Exp / Abs

C#, Mathematica, Oz

sqrt / / abs

PostScript

Sqrt / / ABS

Modula­3

/

exp / abs

Pliant

sqrt / /

Pike

square‐root /

 

9/16/2016

syntax across languages (One Big Page)

exp / abs or absolute

Rebol

Sqrt / Exp / ABS

Classic REXX

sqrt,isqrt / exp / abs

Tcl8.5

fsqrt / fexp / abs,fabs

Forth

/ exp / abs Tcl8.5 fsqrt / fexp / abs,fabs Forth trigonometry basic sin / cos

trigonometry

basic

sin / cos

Ada, 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

/

tan

Sin / Cos

C#, Classic REXX, Mathematica, Oz

/

Tan

sin / cos

Awk, PostScript

/

sine /

 

cosine /

Eiffel, Rebol

tangent

radsin /

 

radcos /

Logo

radtan

fsin /

 

fcos /

Forth

ftan

inverse

asin / acos /

Ada, C, C++, CoffeeScript, Common Lisp, F#, Haskell, Io, JavaScript, Matlab, OCaml, Perl, Perl6, Pike, Pliant, Prolog, Python, Ruby, Scheme, Tcl, Yorick

atan(128)

Asin / Acos / Atan C#, Oz

ASin / ACos / ATan Classic REXX

arcsin / arccos / arctan

Maple

arcSin / arcCos / arcTan

Smalltalk

ArcSin / ArcCos / ArcTan

Mathematica

arcsine /

arccosine /

Rebol

arctangent

arc_sine /

arc_cosine /

Eiffel

arc_tangent

/ / atan

PostScript

/ / radarctan

Logo

9/16/2016

syntax across languages (One Big Page)

fasin / facos /

Forth

fatan

logarithmlanguages (One Big Page) fasin / facos / Forth fatan base e ln Delphi­Kylix, Logo, Maple,

base e

ln Delphi­Kylix, Logo, Maple, Pascal, PostScript, Smalltalk, SML

log Awk, 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

Log Ada, C#, Classic REXX, Mathematica, Oz

log

Haskell

10

log‐

Rebol

e

 

fln Forth

base 10

log10

C, C++, Delphi­Kylix, Eiffel, F#, Io, Logo, Lua, Matlab, OCaml, Perl, Perl6, PHP, Pliant, Prolog, Python, Ruby, Tcl, Yorick

Log10

C#, Classic REXX

log

PostScript, SML

log: 10

Smalltalk

log‐10

Rebol

log[10]

Maple

Log[10, val]

Mathematica

logBase 10

Haskell

Log(X => val, Base => 10.0)

Ada

(log x 10)

Common Lisp

flog

Forth

base 2

log2

Matlab

log‐10 / log‐2

Rebol

Log(X => val, Base => 2.0) Ada

log(val, 2)

Python

Log[2, val]

Mathematica

frexp

C

euclidian division (both quotient and modulo)y t h o n Log[2, val] Mathematica frexp C divmod Python, Ruby

divmod

Python, Ruby

9/16/2016

syntax across languages (One Big Page)

divMod Haskell

divMod

divMod

Haskell

 

div

ldiv lldiv C

 

IntInf.quotrem SML

 

floor

Common Lisp, Dylan

 

/mod

Forth

modulo  floor Common Lisp, Dylan   /mod Forth modulo of ­3 / 2 is 1 %

modulo of ­3 / 2 is 1

%

Classic REXX, Perl, Perl6, Pike, Python, Ruby, Tcl

%%

E

\\

Smalltalk

mod Ada, Common Lisp, Emacs Lisp, Haskell, Matlab, Prolog, SML

Mod Mathematica

MOD

Modula­3

modulo Dylan, Logo, Ruby

rem

Prolog

modulo of ­3 / 2 is ­1

%

Awk, B, C, C#, C++, CoffeeScript, E, F#, Io, Java, JavaScript, PHP, Pliant, Yorick

#

MUMPS

mod

F#, Forth, Lua, OCaml, Oz, Pascal, PostScript, Prolog, XPath

remainder Logo, Ruby, Scheme

rem

Ada, BCPL, Haskell, Matlab, Smalltalk

//

Classic REXX, Rebol

\\

Eiffel

truncate / round / floor / ceilSmalltalk // Classic REXX, Rebol \\ Eiffel trunc / round / floor / ceil C ,

trunc / round / floor / ceil

C, C++, Maple, Matlab

truncate / round / floor / ceiling

Common Lisp, Haskell, Perl6, PostScript, Prolog, Scheme

int

/ round / floor / ceil

CoffeeScript, JavaScript, Pike, Python

int

/ round / /

Logo

to_i, Integer() / round / floor / ceil

Ruby

TRUNC / FORMAT / Floor / Ceil

Classic REXX

Float'Truncation / Float'Rounding / Float'Floor /

Ada

Float'Ceiling(129)

/ round / floor / ceil

E, Io, Java, Lua, PHP, SML, Tcl

9/16/2016

syntax across languages (One Big Page)

/ Round / Floor / Ceiling C #

/ Round / Floor / Ceiling

/ Round / Floor / Ceiling

C#

 

/ Round / Floor / Ceil

Oz

 

/ round / floor / ceiling

Dylan, Emacs Lisp, PostScript, XPath

 

/ ROUND / FLOOR / CEILING

Modula­3

 

/ rounded / floor / ceiling

Eiffel, Smalltalk

 

int / / floor / ceil

F#, Perl

 

int_of_float / / floor / ceil

F#, OCaml

 

/

/ floor / ceil

Lua, Yorick

 

IntegerPart / Round / Floor / Ceiling

Mathematica

 

/

Rounding / Floor / Ceiling

Ada

 

to‐integer / / /

Rebol

 

/

fround / /

Forth

R e b o l   / fround / / F o r t h bitwise

bitwise operators

and / or / xor

& /

|

/ ^

C, C#, C++, CoffeeScript, E, Eiffel, Java, JavaScript, Perl, PHP, Pike, Python, Ruby, Tcl

& /

|

/ ~

Yorick

& /

|

YCP

+& / +| / +^

Perl6

.&. / .|. / xor(130)

Haskell

&&& / ||| / ^^^

F#

and / or / xor

Ada, Forth, PostScript, Rebol

land / lor / lxor

F#, OCaml

logand / logior /

Common Lisp

logxor(131)

bitand / bitor / bitxor

Logo, Matlab

BITAND / BITOR / BITXOR

Classic REXX

BitAnd / BitOr / BitXor

Mathematica

bitAnd / bitOr / bitXor

Smalltalk

bitwiseAnd / bitwiseOr / bitwiseXor

Io

/\ / \/ / xor

Prolog

bitwise inversion

 

C, C#, C++, CoffeeScript, Java, JavaScript, Perl, PHP, Pike, Python, Ruby, SML,

~

Tcl, YCP

~~~

 

9/16/2016

syntax across languages (One Big Page)

 

F#

not

Ada, Eiffel, PostScript

lnot

F#, OCaml

lognot(132)

Common Lisp

bitnot

Eiffel, Logo

BitNot

Mathematica

complement

Haskell, Rebol

bitcmp

Matlab

bitInvert

Smalltalk

bitwiseComplement Io

invert

Forth

\

Prolog

left shift / right shift / unsigned right shift

<< / >> / >>>

CoffeeScript, Java, JavaScript

<< / >>

C, C#, C++, Perl, PHP, Pike, Prolog, Python, Ruby, Tcl, YCP

<<< / >>>

F#

|<< / |>>

Eiffel

lsl / lsr or asr

F#, OCaml

bitshift

Matlab, PostScript

bitShift

Smalltalk

ashift lshift

Logo

lshift / rshift

Forth

shiftL / / shiftR

Haskell

shiftLeft / shiftRight

Io

Shift_Left / Shift_Right / Shift_Right_Arithmetic / Rotate_Left / Rotate_Right

Ada

(ash x positive‐integer) / (ash x negative‐integer) /

Common Lisp

Threads

/ C o m m o n L i s p Threads thread definition class class_name(threading.Thread)

thread definition

class class_name(threading.Thread) {[override run method] }

 

Python

task task_name is [entry entry_name[(parameter

)]

]

end task_name

Ada

task type task_type_name is [entry entry_name[(parameter task_type_name

)]

]

end

Ada

9/16/2016

syntax across languages (One Big Page)

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

Pliant

[post

sequential_instructions]

 

Objective­

[NSThread detachNewThreadSelector:mainFunction toTarget:target withObject:obj]

C

thread creationtoTarget:target withObject:obj] C object t=Thread.Thread(f) P i k e set t [thread

object t=Thread.Thread(f)

Pike

set t [thread create {code}] Tcl

Thread createThread(

)

Io

thread object creationcreate {code}] T c l Thread createThread( ) Io MyTask : task_type_name; A d a class_name

MyTask : task_type_name;

Ada

class_name MyThread = new class_name() Java

p

:= [

] newProcess.

Smalltalk

p

:= [

] fork.(133)

Smalltalk

starting / stopping threadsp := [ ] fork. (133) S m a l l t a l k start()

start() / stop()(134)

Java

resume / suspend / terminate

Smalltalk

Tasks are started when created / call Stop entry or "abort task‐object‐name" Ada

thread send $t {script}

Tcl

passing data directly between threadsA d a thread send $t {script} T c l call an entry with parameters A

call an entry with parameters

Ada

call any public method

Java

common variables are copied at thread creation, in abscence of a "share" statement Pliant

use messages, parameters or shared variables(135)

Smalltalk

terminating thread communication due to a time­outor shared variables (135) S m a l l t a l k select task_entry_call; or

select task_entry_call; or delay timeout_limit; end select; Ada

Thread Synchronizationor delay timeout_limit; end select; A d a

9/16/2016

syntax across languages (One Big Page)

Defining a Synchronized Shared Resource

thread::mutex

Tcl

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, LazyValue

Smalltalk

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_Name Ada

Object_Name.GetMethod()

Java

Monitor Syntax

Objectg_Name.Entry_Name(Parms) Ada

Joining Another Threadv a Monitor Syntax Objectg_Name.Entry_Name(Parms) A d a Suspending a thread until another thread completes Call

Suspending a thread until another thread completes

Call task entry serviced just before task termination Ada

OtherThread.join()

Java, Python

Suspending a Thread Until Another Thread Establishes An Internal State

Call a task entry on the other thread Ada

Thread PrioritizationState Call a task entry on the other thread A d a Selecting a Prioritization Model

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: n

Smalltalk

9/16/2016

syntax across languages (One Big Page)

Thread­safe sharing of data without synchronization9/16/2016 syntax across languages (One Big Page) Ensuring access is atomic pragma Atomic(Object_Name); A d a

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

of the shared data pragma Volatile(Object_Name); A d a Remarks (1) introduced in Scheme in R6RS

Remarks

(1) introduced in Scheme in R6RSshared data pragma Volatile(Object_Name); A d a Remarks (2) when unused (3) for C, it is

(2) when unusedA d a Remarks (1) introduced in Scheme in R6RS (3) for C, it is not

(3) for C, it is not a standard convention, but it is the more widespreada Remarks (1) introduced in Scheme in R6RS (2) when unused (4) any string literal would

(4) any string literal would workis not a standard convention, but it is the more widespread (5) see also =head1, =head2,

(5) see also =head1, =head2, =over, etcit is the more widespread (4) any string literal would work (6) need "file: %script­header.r" in

(6) need "file: %script­header.r" in file headerliteral would work (5) see also =head1, =head2, =over, etc (7) displayed <­ with a special

(7) displayed <­ with a special character(6) need "file: %script­header.r" in file header (8) variable on the right (9) F#: with indentation

(8) variable on the rightfile header (7) displayed <­ with a special character (9) F#: with indentation (10) the variable

(9) F#: with indentation<­ with a special character (8) variable on the right (10) the variable behaves like a

(10) the variable behaves like a pointercharacter (8) variable on the right (9) F#: with indentation (11) cf horizontal layout (12) introduce

(12) introduce scopevariable behaves like a pointer (11) cf horizontal layout (13) Smalltalk: introduce scope (14) ascii representation,

(13) Smalltalk: introduce scopea pointer (11) cf horizontal layout (12) introduce scope (14) ascii representation, original uses a special

(14) ascii representation, original uses a special charsetlayout (12) introduce scope (13) Smalltalk: introduce scope (15) in Modula­2, <> and # are synonyms

(15) in Modula­2, <> and # are synonyms(14) ascii representation, original uses a special charset (16) === and !== differ from == and

(16) === and !== differ from == and != when the objects' type differcharset (15) in Modula­2, <> and # are synonyms (17) for objects (18) normal / structural

(17) for objects!== differ from == and != when the objects' type differ (18) normal / structural /

(18) normal / structural / unification / arithmetic== and != when the objects' type differ (17) for objects (19) structural / mathematical (20)

(19) structural / mathematicalobjects (18) normal / structural / unification / arithmetic (20) deep comparison (21) in List::Util (22)

(20) deep comparison/ unification / arithmetic (19) structural / mathematical (21) in List::Util (22) just 'eval' evaluates

(21) in List::Util(19) structural / mathematical (20) deep comparison (22) just 'eval' evaluates JavaScript (23) Univ

(22) just 'eval' evaluates JavaScript/ mathematical (20) deep comparison (21) in List::Util (23) Univ operator (24) starting with PHP 5.3

(23) Univ operatorin List::Util (22) just 'eval' evaluates JavaScript (24) starting with PHP 5.3 (25) procedure call (26)

(24) starting with PHP 5.3just 'eval' evaluates JavaScript (23) Univ operator (25) procedure call (26) in Pliant, special sugar for

(25) procedure callJavaScript (23) Univ operator (24) starting with PHP 5.3 (26) in Pliant, special sugar for only

(26) in Pliant, special sugar for only one parameterUniv operator (24) starting with PHP 5.3 (25) procedure call (27) only for one parameter (28)

(27) only for one parametercall (26) in Pliant, special sugar for only one parameter (28) only for two parameters (29)

(28) only for two parameterssugar for only one parameter (27) only for one parameter (29) f is a block (30)

(29) f is a block(27) only for one parameter (28) only for two parameters (30) Python >= 2.5 (31) it

(30) Python >= 2.5one parameter (28) only for two parameters (29) f is a block (31) it does not

(31) it does not scale to 3rd argumentfor two parameters (29) f is a block (30) Python >= 2.5 (32) lambda (x .

(32) lambda (x . y)Python >= 2.5 (31) it does not scale to 3rd argument (33) when callee has special

(33) when callee has special "&" prototype(31) it does not scale to 3rd argument (32) lambda (x . y) (34) this is

(34) this is a block, not precisely a function, but it's alike. y) (33) when callee has special "&" prototype (35) manual declaration of local variables wanted

(35) manual declaration of local variables wanted in the closureis a block, not precisely a function, but it's alike (36) see also: #1 + #2

(36) see also: #1 + #2 &manual declaration of local variables wanted in the closure (37) also works for procedures: proc {$

(37) also works for procedures: proc {$ A B}variables wanted in the closure (36) see also: #1 + #2 & (38) x, y, z

(38) x, y, z are the parameters#1 + #2 & (37) also works for procedures: proc {$ A B} (39) method is

(39) method is optionalfor procedures: proc {$ A B} (38) x, y, z are the parameters (40) in Lua,

(40) in Lua, "return xxx" can only appear before a block end. in Matlab, only in inline(' ')A B} (38) x, y, z are the parameters (39) method is optional (41) "return" is

(41) "return" is used when there is no value to returnbefore a block end. in Matlab, only in inline(' ') end

end

9/16/2016

syntax across languages (One Big Page)

(42) in Matlab, only for anonymous function9/16/2016 syntax across languages (One Big Page) (43) firefox (44) C#4, only for "dynamic" objects (45)

(43) firefox(One Big Page) (42) in Matlab, only for anonymous function (44) C#4, only for "dynamic" objects

(44) C#4, only for "dynamic" objects(42) in Matlab, only for anonymous function (43) firefox (45) the result goes to "e" (46)

(45) the result goes to "e"(43) firefox (44) C#4, only for "dynamic" objects (46) "break"s are mandatory, even for

(46) "break"s are mandatory, even for "default"!objects (45) the result goes to "e" (47) Perl >= 5.8.0 (48) 1 is optional in

(47) Perl >= 5.8.0"break"s are mandatory, even for "default"! (48) 1 is optional in this example, since min is

(48) 1 is optional in this example, since min is 1 by defaulteven for "default"! (47) Perl >= 5.8.0 (49) in Ruby, see also catch/throw (50) often provided

(49) in Ruby, see also catch/throw1 is optional in this example, since min is 1 by default (50) often provided in

(50) often provided in the abbreviated form call/ccsince min is 1 by default (49) in Ruby, see also catch/throw (51) matches an expression

(51) matches an expression of type t(50) often provided in the abbreviated form call/cc (52) type is infered (53) expression "e" is

(52) type is inferedform call/cc (51) matches an expression of type t (53) expression "e" is cast to the

(53) expression "e" is cast to the type of "v"(51) matches an expression of type t (52) type is infered (54) for parameters (55) quite

(54) for parametersexpression "e" is cast to the type of "v" (55) quite bad: only the reference is

(55) quite bad: only the reference is non­mutable whereas the object is still mutableis cast to the type of "v" (54) for parameters (56) eventual send (57) properties are

(56) eventual sendis non­mutable whereas the object is still mutable (57) properties are something alike attributes, but really

(57) properties are something alike attributes, but really are methodswhereas the object is still mutable (56) eventual send (58) one level depth (59) general deep

(58) one level depthare something alike attributes, but really are methods (59) general deep copy function (60) object cloning

(59) general deep copy functionattributes, but really are methods (58) one level depth (60) object cloning is the default, uses

(60) object cloning is the default, uses the copy constructor in C++methods (58) one level depth (59) general deep copy function (61) or simply o_ := o

(61) or simply o_ := o for non­polymorphic objectscloning is the default, uses the copy constructor in C++ (62) c'Class is the class rooted

(62) c'Class is the class rooted in cin C++ (61) or simply o_ := o for non­polymorphic objects (63) see also isMemberOf (64)

(63) see also isMemberOfobjects (62) c'Class is the class rooted in c (64) assignment attempt (65) see also callable(obj.meth)

(64) assignment attemptis the class rooted in c (63) see also isMemberOf (65) see also callable(obj.meth) for unbound

(65) see also callable(obj.meth) for unbound methods unbound methods

(66) in Python, usually called self(65) see also callable(obj.meth) for unbound methods (67) ":" is for external symbols only, recommended

(67) ":" is for external symbols only, recommendedfor unbound methods (66) in Python, usually called self (68) directory name is package name (69)

(68) directory name is package name(67) ":" is for external symbols only, recommended (69) if names are exported using @EXPORT (70)

(69) if names are exported using @EXPORTonly, recommended (68) directory name is package name (70) if names are not exported or are

(70) if names are not exported or are exported using @EXPORT_OKis package name (69) if names are exported using @EXPORT (71) deprecated in ANSI Common Lisp,

(71) deprecated in ANSI Common Lisp, but used in ASDFif names are not exported or are exported using @EXPORT_OK (72) using a correspondance from the

(72) using a correspondance from the package name to the file name(71) deprecated in ANSI Common Lisp, but used in ASDF (73) inside a function (74) since

(73) inside a functiona correspondance from the package name to the file name (74) since PHP 5.3 (75) no

(74) since PHP 5.3the package name to the file name (73) inside a function (75) no spaces (76) when

(75) no spacesto the file name (73) inside a function (74) since PHP 5.3 (76) when using format

(76) when using format(73) inside a function (74) since PHP 5.3 (75) no spaces (77) need expandMacros (78) where

(77) need expandMacros(74) since PHP 5.3 (75) no spaces (76) when using format (78) where T is the

(78) where T is the type of the value(75) no spaces (76) when using format (77) need expandMacros (79) see also cPickle (80) but

(79) see also cPickle(77) need expandMacros (78) where T is the type of the value (80) but not using

(80) but not using the C­like %­syntax(78) where T is the type of the value (79) see also cPickle (81) adding an

(81) adding an end­of­linesee also cPickle (80) but not using the C­like %­syntax (82) in BourneShell, adding an end­of­line

(82) in BourneShell, adding an end­of­linenot using the C­like %­syntax (81) adding an end­of­line (83) adding an end­of­line unless already

(83) adding an end­of­line unless already newline­terminatedend­of­line (82) in BourneShell, adding an end­of­line (84) faster than isEqual (85) the string is represented

(84) faster than isEqualadding an end­of­line unless already newline­terminated (85) the string is represented on the stack as (addr

(85) the string is represented on the stack as (addr len)unless already newline­terminated (84) faster than isEqual (86) in Lua >= 5.0 (87) in C++, is

(86) in Lua >= 5.0(85) the string is represented on the stack as (addr len) (87) in C++, is range­checked

(87) in C++, is range­checked whereas a[i] is noton the stack as (addr len) (86) in Lua >= 5.0 (88) ESI dialect (89) beware

(88) ESI dialect5.0 (87) in C++, is range­checked whereas a[i] is not (89) beware of 0.0 which is

(89) beware of 0.0 which is true in Pike!C++, is range­checked whereas a[i] is not (88) ESI dialect (90) Smalltalk: postfix operator (91) in

(90) Smalltalk: postfix operator(88) ESI dialect (89) beware of 0.0 which is true in Pike! (91) in Modula­2, "&"

(91) in Modula­2, "&" and "and" are synonyms0.0 which is true in Pike! (90) Smalltalk: postfix operator (92) in Oz, simple functions, not

(92) in Oz, simple functions, not operatorsin Modula­2, "&" and "and" are synonyms (93) new in PHP 5.4 (94) restricted to initialisation

(93) new in PHP 5.4are synonyms (92) in Oz, simple functions, not operators (94) restricted to initialisation of a local

(94) restricted to initialisation of a local variable in C and C++in Oz, simple functions, not operators (93) new in PHP 5.4 (95) a b c must

(95) a b c must be constantsto initialisation of a local variable in C and C++

9/16/2016

syntax across languages (One Big Page)

(96) beware, if you give only one integer argument, it is the size!9/16/2016 syntax across languages (One Big Page) (97) for write access: a i o put (98)

(97) for write access: a i o putif you give only one integer argument, it is the size! (98) in C++, it is

(98) in C++, it is range­checked whereas a[i] is not. in Smalltalk, for write access: a :at i :put oargument, it is the size! (97) for write access: a i o put (99) see also

(99) see also Heada[i] is not. in Smalltalk, for write access: a :at i :put o (100) list comprehension

(100) list comprehensionfor write access: a :at i :put o (99) see also Head (101) not in standard

(101) not in standarda :at i :put o (99) see also Head (100) list comprehension (102) in C++, it

(102) in C++, it is done in placesee also Head (100) list comprehension (101) not in standard (103) in Scheme, not standard, but

(103) in Scheme, not standard, but nearly standard(101) not in standard (102) in C++, it is done in place (104) the result is

(104) the result is not guaranteed to be the same as the order in the inputin place (103) in Scheme, not standard, but nearly standard (105) in Perl, in List::Util (106)

(105) in Perl, in List::Utilis not guaranteed to be the same as the order in the input (106) Borland extension

(106) Borland extension in Pascalsame as the order in the input (105) in Perl, in List::Util (107) prefix (108) postfix

(107) prefixin Perl, in List::Util (106) Borland extension in Pascal (108) postfix (109) infix (110) optional value

(108) postfixin List::Util (106) Borland extension in Pascal (107) prefix (109) infix (110) optional value is only

(109) infix(106) Borland extension in Pascal (107) prefix (108) postfix (110) optional value is only for pointers

(110) optional value is only for pointersextension in Pascal (107) prefix (108) postfix (109) infix (111) only for "access" types in Ada

(111) only for "access" types in Ada(109) infix (110) optional value is only for pointers (112) introduced in Perl 5.10 (113) attribute

(112) introduced in Perl 5.10for pointers (111) only for "access" types in Ada (113) attribute selector (114) Java: introduced in

(113) attribute selector"access" types in Ada (112) introduced in Perl 5.10 (114) Java: introduced in 1.5 (115) n1,

(114) Java: introduced in 1.5Ada (112) introduced in Perl 5.10 (113) attribute selector (115) n1, n2, (116) returns an iterator

(115) n1, n2,5.10 (113) attribute selector (114) Java: introduced in 1.5 (116) returns an iterator (117) right­bias (118)

(116) returns an iteratorselector (114) Java: introduced in 1.5 (115) n1, n2, (117) right­bias (118) left­bias (119) jot on

(117) right­biasintroduced in 1.5 (115) n1, n2, (116) returns an iterator (118) left­bias (119) jot on BSD

(118) left­bias(115) n1, n2, (116) returns an iterator (117) right­bias (119) jot on BSD (120) long is

(119) jot on BSD(116) returns an iterator (117) right­bias (118) left­bias (120) long is a big integer (121) fixed

(120) long is a big integeriterator (117) right­bias (118) left­bias (119) jot on BSD (121) fixed point (122) 0b1 new in

(121) fixed pointleft­bias (119) jot on BSD (120) long is a big integer (122) 0b1 new in PHP

(122) 0b1 new in PHP 5.4jot on BSD (120) long is a big integer (121) fixed point (123) integers are decimals

(123) integers are decimalsis a big integer (121) fixed point (122) 0b1 new in PHP 5.4 (124) with mathematical

(124) with mathematical prioritiespoint (122) 0b1 new in PHP 5.4 (123) integers are decimals (125) APL uses a real

(125) APL uses a real multiplication sign for multiplication from a special character setintegers are decimals (124) with mathematical priorities (126) for each various types (127) from instances of

(126) for each various typessign for multiplication from a special character set (127) from instances of Ada.Numerics.Float_Random or

(127) from instances of Ada.Numerics.Float_Random or Ada.Numerics.Discrete_Randomfrom a special character set (126) for each various types (128) Ruby >= 1.7 (129) replace

(128) Ruby >= 1.7of Ada.Numerics.Float_Random or Ada.Numerics.Discrete_Random (129) replace Float with whatever type you are using (130)

(129) replace Float with whatever type you are usingor Ada.Numerics.Discrete_Random (128) Ruby >= 1.7 (130) in module Data.Bits (131) see also bit­and / bit­or

(130) in module Data.Bits1.7 (129) replace Float with whatever type you are using (131) see also bit­and / bit­or

(131) see also bit­and / bit­or / bit­xorwith whatever type you are using (130) in module Data.Bits (132) see also bit­not (133) equivalent

(132) see also bit­notData.Bits (131) see also bit­and / bit­or / bit­xor (133) equivalent to newProcess + resume (134)

(133) equivalent to newProcess + resumealso bit­and / bit­or / bit­xor (132) see also bit­not (134) "stop" is now deprecated (135)

(134) "stop" is now deprecatedsee also bit­not (133) equivalent to newProcess + resume (135) a thread is created from a

(135) a thread is created from a block, which is a closure on the variables as seen by the blocknewProcess + resume (134) "stop" is now deprecated Similar Pages Belorussian translation of this page

Similar Pages

9/16/2016

syntax across languages (One Big Page)

References

SQL SQL

Credits

Yoann 'Pad' Padioleau (Haskell additions, Beta, various fixes)Tasks in many languages References BCPL Eiffel SQL Credits Jakub Travnik (Pascal, Delphi­Kylix) Robert Feldt (Ruby

Jakub Travnik (Pascal, Delphi­Kylix)Padioleau (Haskell additions, Beta, various fixes) Robert Feldt (Ruby additions) Pascal Terjan (PHP) Carlos

Robert Feldt (Ruby additions)Beta, various fixes) Jakub Travnik (Pascal, Delphi­Kylix) Pascal Terjan (PHP) Carlos 'angus' (PostScript) Axel

Pascal Terjan (PHP)(Pascal, Delphi­Kylix) Robert Feldt (Ruby additions) Carlos 'angus' (PostScript) Axel Kittenberger

Carlos 'angus' (PostScript)Robert Feldt (Ruby additions) Pascal Terjan (PHP) Axel Kittenberger (various) Guido van Rossum (block vs

Axel Kittenberger (various)Pascal Terjan (PHP) Carlos 'angus' (PostScript) Guido van Rossum (block vs scoping) Jeffrey Hobbs (Tcl)

Guido van Rossum (block vs scoping)'angus' (PostScript) Axel Kittenberger (various) Jeffrey Hobbs (Tcl) Mark­Jason Dominus (SML, various) Ash

Jeffrey Hobbs (Tcl)Kittenberger (various) Guido van Rossum (block vs scoping) Mark­Jason Dominus (SML, various) Ash Searle (Java, PHP,

Mark­Jason Dominus (SML, various)Guido van Rossum (block vs scoping) Jeffrey Hobbs (Tcl) Ash Searle (Java, PHP, JavaScript) Mark S.

Ash Searle (Java, PHP, JavaScript)Jeffrey Hobbs (Tcl) Mark­Jason Dominus (SML, various) Mark S. Miller ( E ) Pete Jinks (various)

Mark S. Miller (E ) E)

Pete Jinks (various) Pete Jinks (various)

Steve Tolkin (various)JavaScript) Mark S. Miller ( E ) Pete Jinks (various) Franck Arnaud (Eiffel) Tom Murphy (SML)

Franck Arnaud (Eiffel)Miller ( E ) Pete Jinks (various) Steve Tolkin (various) Tom Murphy (SML) Guy Steele (Fortran,

Tom Murphy (SML)(various) Steve Tolkin (various) Franck Arnaud (Eiffel) Guy Steele (Fortran, and many various) Carl Gay (Dylan,

Guy Steele (Fortran, and many various)Tolkin (various) Franck Arnaud (Eiffel) Tom Murphy (SML) Carl Gay (Dylan, CommonLisp) Jay nop@nop.com (Lua) Philippe

Carl Gay (Dylan, CommonLisp)Tom Murphy (SML) Guy Steele (Fortran, and many various) Jay nop@nop.com (Lua) Philippe Lhoste (Lua, JavaScript)

Jay nop@nop.com (Lua)(Fortran, and many various) Carl Gay (Dylan, CommonLisp) Philippe Lhoste (Lua, JavaScript) Jim Rogers (Ada, Java,

Philippe Lhoste (Lua, JavaScript)various) Carl Gay (Dylan, CommonLisp) Jay nop@nop.com (Lua) Jim Rogers (Ada, Java, Threads section) Ketil Z.

Jim Rogers (Ada, Java, Threads section)Jay nop@nop.com (Lua) Philippe Lhoste (Lua, JavaScript) Ketil Z. Malde (Haskell) Mark Carroll ( Modula­3 )

Ketil Z. Malde (Haskell)(Lua, JavaScript) Jim Rogers (Ada, Java, Threads section) Mark Carroll ( Modula­3 ) Keith Wansbrough (Haskell

Mark Carroll (Modula­3 ) Modula­3)

Keith Wansbrough (Haskell and a few SML)Ketil Z. Malde (Haskell) Mark Carroll ( Modula­3 ) Remi Vanicat (OCaml) Matthieu Villeneuve (CommonLisp)

Remi Vanicat (OCaml)( Modula­3 ) Keith Wansbrough (Haskell and a few SML) Matthieu Villeneuve (CommonLisp) Joachim Durchholz (Eiffel)

Matthieu Villeneuve (CommonLisp)Wansbrough (Haskell and a few SML) Remi Vanicat (OCaml) Joachim Durchholz (Eiffel) Walter Vannini (C, "breaking

Joachim Durchholz (Eiffel)SML) Remi Vanicat (OCaml) Matthieu Villeneuve (CommonLisp) Walter Vannini (C, "breaking lines" idea) Peter

Walter Vannini (C, "breaking lines" idea)Matthieu Villeneuve (CommonLisp) Joachim Durchholz (Eiffel) Peter Lewerin (Tcl) Patrice Ossona de Mendez (Pliant) Bert

Peter Lewerin (Tcl)(Eiffel) Walter Vannini (C, "breaking lines" idea) Patrice Ossona de Mendez (Pliant) Bert Freudenberg

Patrice Ossona de Mendez (Pliant)(C, "breaking lines" idea) Peter Lewerin (Tcl) Bert Freudenberg (Smalltalk & Squeak additions

Bert Freudenberg (Smalltalk & Squeak additions corrections)idea) Peter Lewerin (Tcl) Patrice Ossona de Mendez (Pliant) Dennis Haney (Perl, C#) Fergus Henderson (Mercury)

Dennis Haney (Perl, C#)Freudenberg (Smalltalk & Squeak additions corrections) Fergus Henderson (Mercury) Ralph Becket (Mercury) Bill

Fergus Henderson (Mercury)& Squeak additions corrections) Dennis Haney (Perl, C#) Ralph Becket (Mercury) Bill Thornton (Java) Nik Crabtree

Ralph Becket (Mercury)Dennis Haney (Perl, C#) Fergus Henderson (Mercury) Bill Thornton (Java) Nik Crabtree (C#) Neal Holtz (Python)

Bill Thornton (Java)(Perl, C#) Fergus Henderson (Mercury) Ralph Becket (Mercury) Nik Crabtree (C#) Neal Holtz (Python)

Nik Crabtree (C#)(Mercury) Ralph Becket (Mercury) Bill Thornton (Java) Neal Holtz (Python)

Neal Holtz (Python)Becket (Mercury) Bill Thornton (Java) Nik Crabtree (C#)

9/16/2016

syntax across languages (One Big Page)

Donald Chai (Python)9/16/2016 syntax across languages (One Big Page) Fred Spiessens (Oz) Martin Nilsson (Pike) Theodore Eastman

Fred Spiessens (Oz)syntax across languages (One Big Page) Donald Chai (Python) Martin Nilsson (Pike) Theodore Eastman (VisualBasic) George

Martin Nilsson (Pike)(One Big Page) Donald Chai (Python) Fred Spiessens (Oz) Theodore Eastman (VisualBasic) George Herson (Eiffel) Lee

Theodore Eastman (VisualBasic)Chai (Python) Fred Spiessens (Oz) Martin Nilsson (Pike) George Herson (Eiffel) Lee Denison (Tcl) Anton Rolls

George Herson (Eiffel)(Oz) Martin Nilsson (Pike) Theodore Eastman (VisualBasic) Lee Denison (Tcl) Anton Rolls (Rebol) Pedro (Lua) Nathan

Lee Denison (Tcl)(Pike) Theodore Eastman (VisualBasic) George Herson (Eiffel) Anton Rolls (Rebol) Pedro (Lua) Nathan Sharfi (C99, C#,

Anton Rolls (Rebol)(VisualBasic) George Herson (Eiffel) Lee Denison (Tcl) Pedro (Lua) Nathan Sharfi (C99, C#, C++) Dirk Gerrits

Pedro (Lua)George Herson (Eiffel) Lee Denison (Tcl) Anton Rolls (Rebol) Nathan Sharfi (C99, C#, C++) Dirk Gerrits

Nathan Sharfi (C99, C#, C++)(Eiffel) Lee Denison (Tcl) Anton Rolls (Rebol) Pedro (Lua) Dirk Gerrits (Common Lisp, Scheme, Emacs Lisp)

Dirk Gerrits (Common Lisp, Scheme, Emacs Lisp)Anton Rolls (Rebol) Pedro (Lua) Nathan Sharfi (C99, C#, C++) Tabitha Arrowny (Ruby, Python, Perl, Péter

Tabitha Arrowny (Ruby, Python, Perl,C#, C++) Dirk Gerrits (Common Lisp, Scheme, Emacs Lisp) Péter Varga (BourneShell, Common Lisp, Ian Henderson

Péter Varga (BourneShell, Common Lisp,Scheme, Emacs Lisp) Tabitha Arrowny (Ruby, Python, Perl, Ian Henderson (Objective C) Anthony Borla (Classic REXX,

Ian Henderson (Objective C)(Ruby, Python, Perl, Péter Varga (BourneShell, Common Lisp, Anthony Borla (Classic REXX, Prolog, Logo) Paul McJones

Anthony Borla (Classic REXX, Prolog, Logo)Varga (BourneShell, Common Lisp, Ian Henderson (Objective C) Paul McJones (Modula­3 fixes) Uwe Kolb (Smalltalk fixes)

Paul McJones (Modula­3 fixes)(Objective C) Anthony Borla (Classic REXX, Prolog, Logo) Uwe Kolb (Smalltalk fixes) Ciaran McNulty (PHP) David

Uwe Kolb (Smalltalk fixes)(Classic REXX, Prolog, Logo) Paul McJones (Modula­3 fixes) Ciaran McNulty (PHP) David B. Nagle (Yorick) Michael

Ciaran McNulty (PHP)Paul McJones (Modula­3 fixes) Uwe Kolb (Smalltalk fixes) David B. Nagle (Yorick) Michael Schaufelberger (Eiffel)

David B. Nagle (Yorick)fixes) Uwe Kolb (Smalltalk fixes) Ciaran McNulty (PHP) Michael Schaufelberger (Eiffel) Samuel Charron (Erlang) Kyle

Michael Schaufelberger (Eiffel)fixes) Ciaran McNulty (PHP) David B. Nagle (Yorick) Samuel Charron (Erlang) Kyle Ross (OCaml) Damien Krotkine

Samuel Charron (Erlang)David B. Nagle (Yorick) Michael Schaufelberger (Eiffel) Kyle Ross (OCaml) Damien Krotkine (Ruby) Guillaume

Kyle Ross (OCaml)Michael Schaufelberger (Eiffel) Samuel Charron (Erlang) Damien Krotkine (Ruby) Guillaume Cottenceau (Java)

Damien Krotkine (Ruby)(Eiffel) Samuel Charron (Erlang) Kyle Ross (OCaml) Guillaume Cottenceau (Java) David.Whitten (MUMPS) Phil

Guillaume Cottenceau (Java)Charron (Erlang) Kyle Ross (OCaml) Damien Krotkine (Ruby) David.Whitten (MUMPS) Phil Howard (various) Andrzej Zawadzki

David.Whitten (MUMPS)(OCaml) Damien Krotkine (Ruby) Guillaume Cottenceau (Java) Phil Howard (various) Andrzej Zawadzki (Ruby) Stuart Brady

Phil Howard (various)(Ruby) Guillaume Cottenceau (Java) David.Whitten (MUMPS) Andrzej Zawadzki (Ruby) Stuart Brady (VisualBasic) Joris

Andrzej Zawadzki (Ruby)(Java) David.Whitten (MUMPS) Phil Howard (various) Stuart Brady (VisualBasic) Joris Gillis (Maple) Garrett

Stuart Brady (VisualBasic)(MUMPS) Phil Howard (various) Andrzej Zawadzki (Ruby) Joris Gillis (Maple) Garrett Wollman (Ruby, BourneShell, C )

Joris Gillis (Maple)(various) Andrzej Zawadzki (Ruby) Stuart Brady (VisualBasic) Garrett Wollman (Ruby, BourneShell, C ) Claus Gittinger

Garrett Wollman (Ruby, BourneShell, C )(Ruby) Stuart Brady (VisualBasic) Joris Gillis (Maple) Claus Gittinger (Smalltalk) Bobby 'nneonneo' Xiao

Claus Gittinger (Smalltalk)Joris Gillis (Maple) Garrett Wollman (Ruby, BourneShell, C ) Bobby 'nneonneo' Xiao (Python) Michael Schlenker

Bobby 'nneonneo' Xiao (Python)Wollman (Ruby, BourneShell, C ) Claus Gittinger (Smalltalk) Michael Schlenker (Tcl) Alex Vondrak (Python) Daniel Laberge

Michael Schlenker (Tcl)Gittinger (Smalltalk) Bobby 'nneonneo' Xiao (Python) Alex Vondrak (Python) Daniel Laberge (Pascal) Daniel Wagner

Alex Vondrak (Python)'nneonneo' Xiao (Python) Michael Schlenker (Tcl) Daniel Laberge (Pascal) Daniel Wagner (Haskell) Bob Bane

Daniel Laberge (Pascal)Xiao (Python) Michael Schlenker (Tcl) Alex Vondrak (Python) Daniel Wagner (Haskell) Bob Bane (Common Lisp) Alan

Daniel Wagner (Haskell)(Tcl) Alex Vondrak (Python) Daniel Laberge (Pascal) Bob Bane (Common Lisp) Alan Hogan (Java) Steve Davison

Bob Bane (Common Lisp)(Python) Daniel Laberge (Pascal) Daniel Wagner (Haskell) Alan Hogan (Java) Steve Davison (C) Konstantin Yegupov (PHP,

Alan Hogan (Java)(Pascal) Daniel Wagner (Haskell) Bob Bane (Common Lisp) Steve Davison (C) Konstantin Yegupov (PHP, Python )

Steve Davison (C)Wagner (Haskell) Bob Bane (Common Lisp) Alan Hogan (Java) Konstantin Yegupov (PHP, Python ) Noé Rubinstein

Konstantin Yegupov (PHP, Python )Bob Bane (Common Lisp) Alan Hogan (Java) Steve Davison (C) Noé Rubinstein (Io, CoffeeScript) Florentin Millour

Noé Rubinstein (Io, CoffeeScript)(Java) Steve Davison (C) Konstantin Yegupov (PHP, Python ) Florentin Millour (Yorick) Axel Liljencrantz (FishShell)

Florentin Millour (Yorick)Yegupov (PHP, Python ) Noé Rubinstein (Io, CoffeeScript) Axel Liljencrantz (FishShell) Sanghyeon Seo (Lua) Szabolcs

Axel Liljencrantz (FishShell)Rubinstein (Io, CoffeeScript) Florentin Millour (Yorick) Sanghyeon Seo (Lua) Szabolcs Horvát (Mathematica) Laurent

Sanghyeon Seo (Lua)Florentin Millour (Yorick) Axel Liljencrantz (FishShell) Szabolcs Horvát (Mathematica) Laurent Le Brun (F#,

Szabolcs Horvát (Mathematica)(Yorick) Axel Liljencrantz (FishShell) Sanghyeon Seo (Lua) Laurent Le Brun (F#, GNU­sed) Julien Hall (Smalltalk) Ian

Laurent Le Brun (F#, GNU­sed)Sanghyeon Seo (Lua) Szabolcs Horvát (Mathematica) Julien Hall (Smalltalk) Ian Osgood (Forth) Dmitry A. Kazakov

Julien Hall (Smalltalk)Horvát (Mathematica) Laurent Le Brun (F#, GNU­sed) Ian Osgood (Forth) Dmitry A. Kazakov (Ada) Peter Hermann

Ian Osgood (Forth)Laurent Le Brun (F#, GNU­sed) Julien Hall (Smalltalk) Dmitry A. Kazakov (Ada) Peter Hermann (Ada) Ian

Dmitry A. Kazakov (Ada)(F#, GNU­sed) Julien Hall (Smalltalk) Ian Osgood (Forth) Peter Hermann (Ada) Ian Jackson (Tcl, Perl, C,

Peter Hermann (Ada)Hall (Smalltalk) Ian Osgood (Forth) Dmitry A. Kazakov (Ada) Ian Jackson (Tcl, Perl, C, Assembler )

Ian Jackson (Tcl, Perl, C, Assembler )Osgood (Forth) Dmitry A. Kazakov (Ada) Peter Hermann (Ada) Steve Breese Nils M Holm (Scheme, Stas

Steve BreesePeter Hermann (Ada) Ian Jackson (Tcl, Perl, C, Assembler ) Nils M Holm (Scheme, Stas Malyshev

Nils M Holm (Scheme,(Ada) Ian Jackson (Tcl, Perl, C, Assembler ) Steve Breese Stas Malyshev (PHP5) ) ) )

Stas Malyshev (PHP5)(Tcl, Perl, C, Assembler ) Steve Breese Nils M Holm (Scheme, ) ) )

)

)

)

9/16/2016

syntax across languages (One Big Page)

Pixel This document is licensed under GFDL (GNU Free Documentation License). Generated from syntax­across­languages.html.pl $Id: syntax­across­languages.html.pl 408 2008­08­29 08:32:23Z pixel $