f(a,b,...) | Ada, Awk, Awk, B, C, C#, C++, CoffeeScript, CSS, Dylan, E, Eiffel, Erlang, Go, Io, Java, JavaScript, Lua, Maple, Matlab, Mercury, merd, Modula-3, Pascal, Perl, Perl6, PHP, Pike, Prolog, Python, Ruby, XPath, YCP, Yorick |
f a b ... | BourneShell, F#, FishShell, Haskell, Logo, Matlab, MSH, OCaml, Pliant, Rebol, SML, Tcl |
f(a,b,...f) or f[a,b,...] depending on the version | BCPL |
(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, ...(1) | 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(2) | FL |
f@a(3) | Mathematica |
a // f(3) | Mathematica |
a ~ f ~ b(4) | Mathematica |
.. [ f, A, B, ...] | Prolog |
<xsl:call-template name="f"> <xsl:with-param name="a" select=a/> <xsl:with-param name="b" select=b/> </xsl:call-template> | XSLT |
with no parameter
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#, Go, Java, JavaScript, Lua, Maple, merd, OCaml, Perl, PHP, Pike, Python, SML, YCP |
(f) | Common Lisp, Emacs Lisp, Scheme |
(funcall f) | Common Lisp, Emacs Lisp |
{f} | Oz |
f[] | Mathematica |
f[] or f.call | Ruby |
&$f or $f->() | Perl |
$f.() | Perl6 |
v = f() | Classic REXX |
call f | Classic REXX, Fortran |
f value(5) | Smalltalk |
<xsl:call-template name="f">/ | XSLT |
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)(6) | Python |
interp alias {} f_a {} f a | Tcl |
give the second argument
f(,b) | merd |
&f.assuming(b => b) | Perl6 |
flip f b(7) | Haskell |
give the first argument to operator ">"
(a >) | Haskell, merd |
(>) a | F#, OCaml |
give the second argument to operator ">"
(> a) | Haskell, merd |
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 |
proc f {para1 para2} { ... } | Tcl |
function retval = f(para1, para2) retval = ... | Matlab, Scilab |
:- func f(typ1, typ2, ...) = typ0. f(Para1, Para2, ...) = ... | Mercury |
function f(para1 : type1; para2 : typ2; ...) return retval is begin ... end f; | Ada |
function f para1 para2 -> retval arg typ1 para1; arg typ2 para2; arg rettyp retval; ... | Pliant |
function f(para1 : typ1, para2 : typ2, ...) : retval; var retval : typ0; begin ... end | Pascal |
f (para1 : typ1; para2, para3 : typ2; ...) : rettyp is do ... end | Eiffel |
<xsl:template name="f"> <xsl:param name="para1"/> <xsl:param name="para2"/> ... </xsl:template> | XSLT |
Function f(para1, para2) ... End Function | Visual Basic |
: f ... ; | Forth |
f() { ... } | BourneShell, KornShell |
f : procedure ... return retval | Classic REXX |
to f :para1 :para2 ... end | Logo |
func f(para1 typ1, para2 typ2, ...) (typ3, ...) { ... } | Go |
procedures
procedure f(para1 : typ1; para2, para3 : typ2); begin ... end | Pascal |
f (para1 : typ1; para2, para3 : typ2; ...) is do ... end | Eiffel |
procedure f(para1 : typ1; para2 : MODE type2; ...) is begin ... end f; MODE ::= | OUT | IN OUT | Ada |
void f(typ1 para1, typ2 para2, ...) { ... } | C, C#, C++, Pike |
let f(para1, para2, ...) be $( ... $) | BCPL |
proc { F Para1 Para2 } ... 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 |
func f(para1 typ1, para2 typ2, ...) { ... } | Go |
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}) end | Matlab |
function f(varargin) for e=varargin ...(e) end | Scilab |
(args...) -> ... | CoffeeScript |
(lambda x ...) or(8) | Scheme |
f(args ...typ0)(9) | Go |
predicates
f(Para1, Para2, ....) :- ... . | Prolog |
sub { my ($a, $b) = @_; ... } | Perl |
{ my ($a, $b) = @_; ... }(10) | Perl |
{ ... } (arguments are in the stack | PostScript |
[ ... ] | Logo |
{ param(para1, [typ2]para2, ...) ... } | MSH |
{|a, b| ... }(11) | Ruby |
[:a :b| ... ] | Smalltalk |
[list {a b} {...}] | Tcl8.5 |
lambda a, b: ... | Python |
lambda(typ1 para1, typ2, para2, ...) { ... }; | Pike |
(a, b) => ... | C#3, CoffeeScript |
(a, b) -> ... | CoffeeScript, Maple |
a, b -> ... | merd |
-> $a, $b { ... } | Perl6 |
\a b -> ... | Haskell |
:noname ... | Forth |
fn (a, b) => ... | SML |
fun a b -> ... | F#, OCaml |
(func(A, B) = C :- ...) | Mercury |
function(a, b) { ... } | JavaScript, PHP5 |
function(a, b) use (&$v1, $v2) { ... }(12) | PHP5 |
function(a, b) ... end | Lua |
Function[{a, b}, ....](13) | Mathematica |
fun(a, b) -> ... end | Erlang |
fun {$ A B} ... end(14) | 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...')(15) | Matlab |
method(a, b, ...) | Io |
method(a, b) ... end method(16) | Dylan |
create_function(',','...') | PHP |
delegate(ta a, tb b) { ... } | C#2 |
[](ta a, tb b) { ... } | C++-0x |
[](ta a, tb b) -> typ { ... } | C++-0x |
func(para1 typ1, ...) (typ2, ...) { ... } | Go |
breaks the control flow
return(17) | Ada, Awk, B, BCPL, BourneShell, C, C#, C++, Classic REXX, CoffeeScript, Common Lisp, E, FishShell, Go, Io, Java, JavaScript, Lua, Maple, Matlab, Perl, Perl6, PHP, Pike, Pliant, Python, Rebol, Ruby, Tcl, Vimscript, YCP, Yorick |
Return | Mathematica, Visual Basic |
RETURN | Modula-3 |
resultis(18) | BCPL |
return-from xxx | Common Lisp |
^ | Smalltalk |
Exit Function / Exit Sub | Visual Basic |
exit | Forth |
output | Logo |
function body is the result
no syntax needed(19) | 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 |
AUTOLOAD | Perl |
AUTOSCALAR, AUTOMETH, AUTOLOAD... | Perl6 |
__autoload | PHP5 |
__getattr__ | Python |
method_missing | Ruby |
doesNotUnderstand | Smalltalk |
__noSuchMethod__(20) | CoffeeScript, JavaScript |
unknown | Tcl |
no-applicable-method | Common Lisp |
doesNotRecognizeSelector | Objective-C |
TryInvokeMember(21) | C# |
match [name, args] { ... } | E |
the predicate fail | Prolog |
forward | Io |
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 |
runtime.Caller(0) | Go |
. | Haskell |
~ | merd |
o | SML |
@ | Maple |
compose | Dylan |
Composition | Mathematica |
<< | F# |
>> | F# |
id | Haskell |
identity | Common Lisp |
Identity | Mathematica |
yourself | Smalltalk |