until end of line
| # | Awk, E, Icon, Maple, merd, Perl, Perl6, PHP, Pliant, Python, Ruby, sh, 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 |
| {- ... -} | Haskell |
| #| ... |# | Common Lisp |
| #if 0 ... #endif | C |
| comment { ... } | Rebol |
| comment [ ... ] | Rebol |
| { ... } or [ ... ] when unused | 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
| /** ... */ (1) | C, C#, E, Java, PHP |
| {-| ... -} | Haskell |
| (** ... *) | OCaml |
| /* DOCUMENT ... */ | Yorick |
| indexing identifier: "..."; | Eiffel |
| rebol [ Note: "..." ] | Rebol |
| func ["..." arg] ... | Rebol |
class X: """... """ def x(): """... """(2) | Python |
| (define (f para1 para2) "..." ...) | Scheme |
| (defun f (para1 para2) "..." ...) | Common Lisp, Emacs Lisp |
=pod ... =cut(3) | 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 (4) | Rebol |
| SOURCELINE() / parse source OS . SOURCENAME | Classic REXX |
case-sensitivity (keywords, variable identifiers...)
| case-sensitive | Awk, B, C, C#, C++, Haskell, Java, JavaScript, Lua, Maple, Matlab, merd, Modula-3, OCaml, Perl, Perl6, Pike, Pliant, Prolog, Python, Ruby, sh, 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 | sh |
| 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, C, C#, C++, E, Maple, Perl, Perl6, PHP, Python, sh, 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, E, Python, Ruby, sh, Tcl |
| _ | Visual Basic |
| , | Classic REXX |
| ~ | Logo |
| ... | Matlab |
assignment
| = | Awk, B, Basic, C, C#, C++, Classic REXX, Erlang, Icon, Java, JavaScript, Lua, Matlab, Oz, Perl, Perl6, PHP, Pike, sh, YCP, Yorick |
| := | Ada, BCPL, Cecil, Dylan, E, Eiffel, Maple, Modula-3, Pascal, Pliant, Sather, Simula, Smalltalk |
| <- | OCaml |
| _ (5) | Squeak |
| : | BCPL, Rebol |
| -> (6) | Beta |
| def | PostScript |
| setq | Emacs Lisp |
| setf setq set | Common Lisp |
| set | 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 |
| define let let* letrec fluid-let | Scheme |
| let let* flet labels defun defmethod defvar defparameter defsetf .. | Common Lisp |
| local V1 = e V2 = e2 in ... end | Oz |
| global | 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 |
| var gvar | Pliant |
| variable v (7) | 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 (8) | merd |
| { ... } | Awk, JavaScript, PHP, Pike, sh, Tcl, Yorick |
| { ... } (9) | B, C, C#, C++, E, Haskell, Java, Modula-3, Perl, Perl6, YCP |
| ( ... ) (9) | sh |
| [ ... ] | Logo |
| [ x. y. ... ] | Smalltalk |
| begin ... end (9) | Ada, Pascal |
| do ... end | Classic REXX |
| do ... end (9) | Lua, PL/I |
| indentation | MUMPS, Pliant, Python |
| indentation (9) | 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 |
| (* ... *) (10) | 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, Pliant, Rebol |
| = # | Modula-3 |
| = != | sh |
| = <> # (11) | Modula-2 |
| == === != !== (12) | JavaScript, PHP |
| === !== | PHP5 |
| == ~= | Lua |
| == ~~ | Smalltalk |
| == ~== | Dylan |
| = '= | MUMPS |
| = ~= neqv (10) | BCPL |
| is_equal (13) | 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 |
| = /= | Ada |
| = != | XPath |
| = <> | Beta, OCaml, Pascal, Rebol, SML, SQL92, Visual Basic |
| = ~= | Dylan, Smalltalk |
| == ~= eq ne isequal isequalwithequalnans | Matlab |
| == \== / =@= \=@= / = \= / =:= =\= (14) | Prolog |
| .eq | Logo |
| equal? | Scheme |
| equals | Java |
| equal | Emacs Lisp |
| equal, !equal | Pike |
| equal, 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 |
| << >> <<= >>= (15) | Classic REXX |
| @< / @=< / @> / @>= | Prolog |
| lt gt le ge | Perl, Perl6, PostScript |
| -lt -gt -le -ge | MSH, sh |
| .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 (16) | 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 |
| `...` | sh |
| =.. (17) | Prolog |
| doGC | Beta |
| GC.start | Ruby |
| gc | Logo |
| gc() | 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 |