until end of line
# | Awk, BourneShell, E, Icon, Maple, merd, Perl, Perl6, PHP, Pliant, Python, Ruby, Tcl, YAML |
// | BCPL, C#, C++, C99, Dylan, Java, JavaScript, PHP, Pike, 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 |
C or * in column 1 | Fortran |
nestable
(* ... *) | Beta, Modula-3, OCaml, Pascal, SML |
%( ... %) | Matlab |
/* ... */ | Classic REXX, Dylan, Oz, SQL99 |
{ ... } | Pascal, Rebol |
{- ... -} | Haskell |
#| ... |# | Common Lisp |
#if 0 ... #endif | C |
comment { ... } | Rebol |
comment [ ... ] | Rebol |
[ ... ] | Rebol |
--[[ ... ]] | Lua |
non nestable
" ... " | Smalltalk |
/* ... */ | B, C, C#, C++, Java, JavaScript, Mercury, PHP, Pike, PL/I, YCP, Yorick |
<!-- ... --> | HTML, XML |
( ... ) | Forth |
until end of line
/// | C#, Java |
-- | | Haskell |
-- ^ | Haskell |
non nestable
/** ... */ | C, C#, E, Java, PHP |
{-| ... -} | Haskell |
(** ... *) | OCaml |
/* DOCUMENT ... */ | Yorick |
indexing identifier: "..."; | Eiffel |
rebol [ Note: "..." ] | Rebol |
func ["..." arg] ... | Rebol |
class X: """... """ def x(): """... """ |
Python |
(define (f para1 para2) "..." ...) | Scheme |
(defun f (para1 para2) "..." ...) | Common Lisp, Emacs Lisp |
=pod ... =cut |
Perl, Perl6 |
=begin ... =end |
Ruby |
function MYFUNCTION %MYFUNCTION the very first comment line is displayed in the help table of contents % % the remaining lines are displayed when getting help for MYFUNCTION % |
Matlab |
__LINE__ __FILE__ | C, C++, Perl, PHP, Pike, Ruby |
$?LINE $?FILE | Perl6 |
inspect.stack()[0][2] inspect.stack()[0][1] | Python |
(new System.Diagnostics.StackFrame(true)).GetFileLineNumber() (new System.Diagnostics.StackFrame(true)).GetFileName() |
C# |
system/script/header/file | Rebol |
SOURCELINE() / parse source OS . SOURCENAME | Classic REXX |
case-sensitivity (keywords, variable identifiers...)
case-sensitive | Awk, B, BourneShell, C, C#, C++, Haskell, Java, JavaScript, Lua, Maple, Matlab, merd, Modula-3, OCaml, Perl, Perl6, Pike, Pliant, Prolog, Python, Ruby, Smalltalk, Tcl, XML, YAML |
case-insensitive | Ada, Assembler, Classic REXX, Common Lisp, Eiffel, Forth, HTML, Logo, Pascal, PL/I, Rebol, Scheme, SGML, SQL92, Visual Basic |
case-sensitive: variables case-insensitive: keywords, functions, constants... |
PHP |
case-sensitive: identifiers case-insensitive: keywords |
E |
case-sensitive: identifiers case-insensitive: commands |
MUMPS |
if case sensitive, what is the standard way for scrunching together multiple words
CamelCase | C#, E, Haskell, Java, JavaScript, Pascal, Smalltalk, Tcl, Visual Basic |
underscores | merd |
dots | Logo |
hyphens | Common Lisp, Emacs Lisp, Rebol |
underscores for functions, unclear for modules / types / 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 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 |
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]* | 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, BourneShell, C, C#, C++, E, Maple, Perl, Perl6, PHP, Python, Tcl |
[_a-zA-Z][_a-zA-Z0-9]* or '[^']*' | Pliant |
[_a-zA-Z$][_a-zA-Z0-9$]* | Java, 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-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 |
\S+ | 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 |
keyword regexp (if different from variable identifier regexp)
[A-Z]+ | Modula-3 |
type regexp (if different from variable identifier regexp)
[_A-Z][_a-zA-Z0-9']* | Haskell |
[_a-z][_a-zA-Z0-9']* | Mercury, OCaml |
constant regexp (if different from variable identifier regexp)
[A-Z][_a-zA-Z0-9]* | Ruby |
[_A-Z][_a-zA-Z0-9']* | Haskell, OCaml |
[_a-z][_a-zA-Z0-9']* | Mercury |
nothing needed | Ada, B, C, C#, C++, Common Lisp, Eiffel, Emacs Lisp, Forth, Java, JavaScript, Maple, OCaml, Oz, Pascal, Perl, Perl6, PostScript, Rebol, Scheme, Smalltalk, SML, XSLT, YCP |
\ | Awk, BourneShell, E, Python, Ruby, Tcl |
_ | Visual Basic |
, | Classic REXX |
~ | Logo |
... | Matlab |
assignment
= | Awk, B, Basic, BourneShell, C, C#, C++, Classic REXX, Erlang, Icon, Java, JavaScript, Lua, Matlab, Oz, Perl, Perl6, PHP, Pike, YCP, Yorick |
:= | Ada, BCPL, Cecil, Dylan, E, Eiffel, Maple, Modula-3, Pascal, Pliant, Sather, Simula, Smalltalk |
<- | OCaml |
_ | Squeak |
: | BCPL, Rebol |
-> | Beta |
def | PostScript |
setq | Common Lisp, Emacs Lisp |
setf | Common Lisp |
set | Common Lisp, Rebol |
SET v=... | MUMPS |
set! | Scheme |
is | Prolog |
make "v e | Logo |
declaration
= | Haskell, Mercury, Prolog, SML |
<- | Haskell |
:- | Prolog |
let v = e in | OCaml |
let v = e | BCPL |
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 fluid-let | 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 |
:@ | Beta |
NEW v | MUMPS |
v: t | Ada, Eiffel, Pascal |
| v1 v2 | | Smalltalk |
auto v1, v2; extrn v3, v4; | B |
var | JavaScript, Pliant |
gvar | Pliant |
variable v | Forth |
<xsl:variable name="v" select="e"/> | XSLT |
both
= | merd, Python, Ruby |
:= | merd |
set, variable | Tcl |
( ... ) | Ada, Awk, B, BCPL, Beta, C, C#, C++, Classic REXX, E, Eiffel, Haskell, Java, JavaScript, Logo, Lua, Maple, Matlab, merd, Modula-3, MSH, MUMPS, OCaml, Oz, Pascal, Perl, Perl6, PHP, Pike, Pliant, Prolog, Python, Rebol, Ruby, Smalltalk, SML, SQL92, Tcl, XPath, YCP, Yorick |
[ ... ] | Rebol |
indentation | merd |
$ ... | Haskell |
begin ... end | OCaml, Ruby |
BEGIN ... END | Modula-3 |
space | merd |
{ ... } | Awk, BourneShell, JavaScript, PHP, Pike, Tcl, Yorick |
{ ... } | B, C, C#, C++, E, Haskell, Java, Modula-3, Perl, Perl6, YCP |
( ... ) | BourneShell |
[ ... ] | Logo |
[ x. y. ... ] | Smalltalk |
begin ... end | Ada, Pascal |
do ... end | Classic REXX |
do ... end | Lua, PL/I |
indentation | MUMPS, Pliant, Python |
indentation | Haskell, merd |
foo ... end where foo in { if, do, ... } | Modula-2, Ruby |
foo ... end where foo in { if, for, while, ... } | Matlab |
foo ... end where foo in { if, loop, ... } | Eiffel |
foo ... end foo where foo in { if, do, ... } | Ada, Fortran90 |
(* ... *) | BCPL |
(# ... #) | Beta |
valof | BCPL |
do | Perl, Perl6 |
proc() .. end proc | Maple |
shallow
== != | Awk, B, C, C++, Java, OCaml, Perl, Perl6, Pike, Tcl, Yorick |
= /= | Eiffel, Fortran90 |
= <> | Logo, Maple, Modula-2, Pliant, Rebol |
= # | Modula-2, Modula-3 |
= != | BourneShell |
== === != !== | JavaScript, PHP |
=== !== | PHP5 |
== ~= | Lua |
== ~~ | Smalltalk |
== ~== | Dylan |
= '= | MUMPS |
= ~= neqv | BCPL |
is_equal | Eiffel |
equal? | Scheme |
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, YCP |
== <> | Python |
== /= | Haskell |
== \= | Oz |
== \== | Classic REXX, Prolog |
= /= | Ada |
= != | Maple, XPath |
= <> | Beta, OCaml, Pascal, Rebol, SML, SQL92, Visual Basic |
= ~= | Dylan, Smalltalk |
== ~= eq ne isequal isequalwithequalnans | Matlab |
=@= \=@= / = \= / =:= =\= | Prolog |
.eq | Logo |
equal? | Scheme |
equals | Java |
equal | Common Lisp, Emacs Lisp, Pike |
equalp | Common Lisp |
deep_is_equal | Eiffel |
isEqual | Objective-C |
< > <= >= | Ada, Awk, Awk, B, Beta, C, C#, C++, Classic REXX, Common Lisp, Dylan, E, Eiffel, Emacs Lisp, Haskell, Java, JavaScript, Logo, Lua, Maple, Matlab, merd, Modula-3, OCaml, Pascal, Perl, Perl6, PHP, Pike, Pliant, Python, Rebol, Ruby, Scheme, Smalltalk, SML, SQL92, Tcl, Visual Basic, XPath, YCP, Yorick |
< > =< >= | Mercury, Oz |
< > '> '< | MUMPS |
<< >> <<= >>= | Classic REXX |
@< / @=< / @> / @>= | Prolog |
lt gt le ge | Perl, Perl6, PostScript |
-lt -gt -le -ge | BourneShell, MSH |
.LT. .GT. .LE. .GE. | Fortran |
returns 3 values (i.e. inferior, equal or superior)
a <=> b | merd, Perl, Perl6, Ruby |
cmp | Perl, Perl6, Python |
compare | Haskell, Mercury, OCaml, Pliant, Prolog, Smalltalk |
strcmp | 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 | Ada, Beta, C++, Common Lisp, Dylan, E, Eiffel, Haskell, Java, Lua, Maple, Matlab, merd, OCaml, Pike, Pliant, Prolog, Python, Rebol, Scheme, Smalltalk, SQL92 |
min minstr / max maxstr | Perl |
Min / Max | Oz |
MIN / MAX | Classic REXX, Modula-3 |
measure-object -min / measure-object -max | MSH |
eval | Common Lisp, Emacs Lisp, JavaScript, Matlab, Perl, Perl6, PHP, Python, Ruby, Scheme, Tcl, YCP |
dostring | Lua |
Compiler evaluate: | Smalltalk |
runtime_compile / compile + execute | Pliant |
Compiler.evalExpression or Compiler.parseOzVirtualString | Oz |
compile_string | Pike |
interpret | Classic REXX |
run | Logo |
XECUTE | MUMPS |
do / reduce / compose / load | Rebol |
[...] | Tcl |
`...` | BourneShell |
=.. | Prolog |
doGC | Beta |
GC.start | Ruby |
gc | Logo, Maple, Pike |
System.gc() | Java |
System.gcDo | Oz |
System.GC.Collect() | C# |
gc.collect() | Python |
full_collect | Eiffel |
garbage_collect | Mercury, Prolog |
collectgarbage | Lua |
VM.garbageCollect() | JavaScript |
Gc.full_major() | OCaml |
Smalltalk garbageCollect | Smalltalk |
incremental garbage collection => not needed | Perl, Perl6 |
recycle | Rebol |
interp.gc() | E |
(ext:gc) | Common Lisp |