<s>
In	O
mathematics	O
and	O
computer	B-General_Concept
science	I-General_Concept
,	O
apply	O
is	O
a	O
function	O
that	O
applies	B-Algorithm
a	O
function	O
to	O
arguments	O
.	O
</s>
<s>
It	O
is	O
central	O
to	O
programming	O
languages	O
derived	O
from	O
lambda	B-Language
calculus	I-Language
,	O
such	O
as	O
LISP	B-Language
and	O
Scheme	B-Language
,	O
and	O
also	O
in	O
functional	B-Language
languages	I-Language
.	O
</s>
<s>
It	O
has	O
a	O
role	O
in	O
the	O
study	O
of	O
the	O
denotational	B-Application
semantics	I-Application
of	O
computer	O
programs	O
,	O
because	O
it	O
is	O
a	O
continuous	O
function	O
on	O
complete	O
partial	O
orders	O
.	O
</s>
<s>
Apply	O
is	O
also	O
a	O
continuous	O
function	O
in	O
homotopy	O
theory	O
,	O
and	O
,	O
indeed	O
underpins	O
the	O
entire	O
theory	O
:	O
it	O
allows	O
a	O
homotopy	O
deformation	O
to	O
be	O
viewed	O
as	O
a	O
continuous	O
path	O
in	O
the	O
space	B-Algorithm
of	I-Algorithm
functions	I-Algorithm
.	O
</s>
<s>
The	O
most	O
general	O
setting	O
for	O
apply	O
is	O
in	O
category	O
theory	O
,	O
where	O
it	O
is	O
right	O
adjoint	O
to	O
currying	B-Application
in	O
closed	O
monoidal	O
categories	O
.	O
</s>
<s>
A	O
special	O
case	O
of	O
this	O
are	O
the	O
Cartesian	B-Application
closed	I-Application
categories	I-Application
,	O
whose	O
internal	O
language	O
is	O
simply	O
typed	O
lambda	B-Language
calculus	I-Language
.	O
</s>
<s>
In	O
computer	O
programming	O
,	O
apply	O
applies	B-Algorithm
a	O
function	O
to	O
a	O
list	O
of	O
arguments	O
.	O
</s>
<s>
Eval	O
and	O
apply	O
are	O
the	O
two	O
interdependent	O
components	O
of	O
the	O
eval-apply	O
cycle	O
,	O
which	O
is	O
the	O
essence	O
of	O
evaluating	O
Lisp	B-Language
,	O
described	O
in	O
SICP	B-Language
.	O
</s>
<s>
Function	B-Algorithm
application	I-Algorithm
corresponds	O
to	O
beta	O
reduction	O
in	O
lambda	B-Language
calculus	I-Language
.	O
</s>
<s>
This	O
is	O
important	O
in	O
languages	O
with	O
variadic	B-Language
functions	I-Language
,	O
because	O
this	O
is	O
the	O
only	O
way	O
to	O
call	O
a	O
function	O
with	O
an	O
indeterminate	O
(	O
at	O
compile	O
time	O
)	O
number	O
of	O
arguments	O
.	O
</s>
<s>
In	O
Common	B-Language
Lisp	I-Language
apply	O
is	O
a	O
function	O
that	O
applies	B-Algorithm
a	O
function	O
to	O
a	O
list	O
of	O
arguments	O
(	O
note	O
here	O
that	O
"	O
+	O
"	O
is	O
a	O
variadic	B-Language
function	I-Language
that	O
takes	O
any	O
number	O
of	O
arguments	O
)	O
:	O
</s>
<s>
Similarly	O
in	O
Scheme	B-Language
:	O
</s>
<s>
In	O
C++	B-Language
,	O
Bind	O
is	O
used	O
either	O
via	O
the	O
std	O
namespace	O
or	O
via	O
the	O
boost	O
namespace	O
.	O
</s>
<s>
In	O
C#	B-Application
and	O
Java	B-Language
,	O
variadic	O
arguments	O
are	O
simply	O
collected	O
in	O
an	O
array	O
.	O
</s>
<s>
It	O
is	O
not	O
possible	O
to	O
apply	O
an	O
array	O
of	O
arguments	O
to	O
non-variadic	O
parameter	O
without	O
using	O
reflection	B-Language
.	O
</s>
<s>
In	O
Go	B-Application
,	O
typed	O
variadic	O
arguments	O
are	O
simply	O
collected	O
in	O
a	O
slice	O
.	O
</s>
<s>
The	O
caller	O
can	O
not	O
apply	O
an	O
array	O
of	O
arguments	O
to	O
non-variadic	O
parameters	O
,	O
without	O
using	O
reflection	B-Language
..	O
</s>
<s>
In	O
Haskell	B-Language
,	O
functions	O
may	O
be	O
applied	O
by	O
simple	O
juxtaposition	O
:	O
</s>
<s>
In	O
Haskell	B-Language
,	O
the	O
syntax	O
may	O
also	O
be	O
interpreted	O
that	O
each	O
parameter	O
curries	B-Application
its	O
function	O
in	O
turn	O
.	O
</s>
<s>
In	O
JavaScript	B-Language
,	O
function	O
objects	O
have	O
an	O
apply	O
method	O
,	O
the	O
first	O
argument	O
is	O
the	O
value	O
of	O
the	O
this	O
keyword	O
inside	O
the	O
function	O
;	O
the	O
second	O
is	O
the	O
list	O
of	O
arguments	O
:	O
</s>
<s>
In	O
Lua	B-Language
,	O
apply	O
can	O
be	O
written	O
this	O
way	O
:	O
</s>
<s>
In	O
PHP	B-Application
,	O
apply	O
is	O
called	O
call_user_func_array	O
:	O
</s>
<s>
In	O
Python	B-Language
and	O
Ruby	B-Language
,	O
the	O
same	O
asterisk	O
notation	O
used	O
in	O
defining	O
variadic	B-Language
functions	I-Language
is	O
used	O
for	O
calling	O
a	O
function	O
on	O
a	O
sequence	O
and	O
array	O
respectively	O
:	O
</s>
<s>
Python	B-Language
originally	O
had	O
an	O
apply	O
function	O
,	O
but	O
this	O
was	O
deprecated	B-General_Concept
in	O
favour	O
of	O
the	O
asterisk	O
in	O
2.3	O
and	O
removed	O
in	O
3.0	O
.	O
</s>
<s>
In	O
R	B-Language
,	O
do.call	O
constructs	O
and	O
executes	O
a	O
function	O
call	O
from	O
a	O
name	O
or	O
a	O
function	O
and	O
a	O
list	O
of	O
arguments	O
to	O
be	O
passed	O
to	O
it	O
:	O
</s>
<s>
In	O
Smalltalk	B-Application
,	O
block	O
(	O
function	O
)	O
objects	O
have	O
a	O
valueWithArguments	O
:	O
method	O
which	O
takes	O
an	O
array	O
of	O
arguments	O
:	O
</s>
<s>
Since	O
Tcl	B-Operating_System
8.5	O
,	O
a	O
function	O
can	O
be	O
applied	O
to	O
arguments	O
with	O
the	O
apply	O
command	O
where	O
the	O
function	O
is	O
a	O
two	O
element	O
list	O
{	O
args	O
body}	O
or	O
a	O
three	O
element	O
list	O
{	O
args	O
body	O
namespace}	O
.	O
</s>
<s>
Consider	O
a	O
function	O
,	O
that	O
is	O
,	O
where	O
the	O
bracket	O
notation	O
denotes	O
the	O
space	B-Algorithm
of	I-Algorithm
functions	I-Algorithm
from	O
A	O
to	O
B	O
.	O
</s>
<s>
By	O
means	O
of	O
currying	B-Application
,	O
there	O
is	O
a	O
unique	O
function	O
.	O
</s>
<s>
More	O
precisely	O
,	O
curry	B-Application
and	O
apply	O
are	O
adjoint	O
functors	O
.	O
</s>
<s>
The	O
notation	O
for	O
the	O
space	B-Algorithm
of	I-Algorithm
functions	I-Algorithm
from	O
A	O
to	O
B	O
occurs	O
more	O
commonly	O
in	O
computer	B-General_Concept
science	I-General_Concept
.	O
</s>
<s>
There	O
are	O
other	O
common	O
notational	O
differences	O
as	O
well	O
;	O
for	O
example	O
Apply	O
is	O
often	O
called	O
Eval	O
,	O
even	O
though	O
in	O
computer	B-General_Concept
science	I-General_Concept
,	O
these	O
are	O
not	O
the	O
same	O
thing	O
,	O
with	O
eval	O
distinguished	O
from	O
Apply	O
,	O
as	O
being	O
the	O
evaluation	O
of	O
the	O
quoted	O
string	O
form	O
of	O
a	O
function	O
with	O
its	O
arguments	O
,	O
rather	O
than	O
the	O
application	O
of	O
a	O
function	O
to	O
some	O
arguments	O
.	O
</s>
<s>
Also	O
,	O
in	O
category	O
theory	O
,	O
curry	B-Application
is	O
commonly	O
denoted	O
by	O
,	O
so	O
that	O
is	O
written	O
for	O
curry(g )	O
.	O
</s>
<s>
This	O
notation	O
is	O
in	O
conflict	O
with	O
the	O
use	O
of	O
in	O
lambda	B-Language
calculus	I-Language
,	O
where	O
lambda	O
is	O
used	O
to	O
denote	O
bound	O
variables	O
.	O
</s>
<s>
The	O
articles	O
on	O
exponential	O
object	O
and	O
Cartesian	B-Application
closed	I-Application
category	I-Application
provide	O
a	O
more	O
precise	O
discussion	O
of	O
the	O
category-theoretic	O
formulation	O
of	O
this	O
idea	O
.	O
</s>
<s>
Thus	O
the	O
use	O
of	O
lambda	O
here	O
is	O
not	O
accidental	O
;	O
the	O
internal	O
language	O
of	O
Cartesian	B-Application
closed	I-Application
categories	I-Application
is	O
simply-typed	O
lambda	B-Language
calculus	I-Language
.	O
</s>
<s>
The	O
most	O
general	O
possible	O
setting	O
for	O
Apply	O
are	O
the	O
closed	O
monoidal	O
categories	O
,	O
of	O
which	O
the	O
cartesian	B-Application
closed	I-Application
categories	I-Application
are	O
an	O
example	O
.	O
</s>
<s>
In	O
homological	O
algebra	O
,	O
the	O
adjointness	O
of	O
curry	B-Application
and	O
apply	O
is	O
known	O
as	O
tensor-hom	O
adjunction	O
.	O
</s>
<s>
In	O
order	O
theory	O
,	O
in	O
the	O
category	O
of	O
complete	O
partial	O
orders	O
endowed	O
with	O
the	O
Scott	O
topology	O
,	O
both	O
curry	B-Application
and	O
apply	O
are	O
continuous	O
functions	O
(	O
that	O
is	O
,	O
they	O
are	O
Scott	O
continuous	O
)	O
.	O
</s>
<s>
This	O
property	O
helps	O
establish	O
the	O
foundational	O
validity	O
of	O
the	O
study	O
of	O
the	O
denotational	B-Application
semantics	I-Application
of	O
computer	O
programs	O
.	O
</s>
<s>
In	O
algebraic	O
geometry	O
and	O
homotopy	O
theory	O
,	O
curry	B-Application
and	O
apply	O
are	O
both	O
continuous	O
functions	O
when	O
the	O
space	O
of	O
continuous	O
functions	O
from	O
to	O
is	O
given	O
the	O
compact	B-Algorithm
open	I-Algorithm
topology	I-Algorithm
,	O
and	O
is	O
locally	O
compact	O
Hausdorff	O
.	O
</s>
<s>
This	O
result	O
is	O
very	O
important	O
,	O
in	O
that	O
it	O
underpins	O
homotopy	O
theory	O
,	O
allowing	O
homotopic	O
deformations	O
to	O
be	O
understood	O
as	O
continuous	O
paths	O
in	O
the	O
space	B-Algorithm
of	I-Algorithm
functions	I-Algorithm
.	O
</s>
