Update page 'P# 1.0 Draft Specification'
@@ -347,7 +347,9 @@ The above expression in PHP will output 't' and this is an unexpected result, bu
|
|||||||
TODO
|
TODO
|
||||||
|
|
||||||
## 8. Object-Oriented Programming
|
## 8. Object-Oriented Programming
|
||||||
### 8.X. Anonymous Functions
|
TODO
|
||||||
|
|
||||||
|
## 9. Anonymous Functions
|
||||||
Anonymous functions, also known as closures, allow the creation of functions which have no specified name. In P#, anonymous function arguments can take a default value exactly like standard function arguments. The default value associated with the function argument can be any complex expression including function calls.
|
Anonymous functions, also known as closures, allow the creation of functions which have no specified name. In P#, anonymous function arguments can take a default value exactly like standard function arguments. The default value associated with the function argument can be any complex expression including function calls.
|
||||||
|
|
||||||
<%
|
<%
|
||||||
@@ -358,4 +360,4 @@ Anonymous functions, also known as closures, allow the creation of functions whi
|
|||||||
$anon('Welcome guest!'); //You should see 'Welcome guest!'
|
$anon('Welcome guest!'); //You should see 'Welcome guest!'
|
||||||
%>
|
%>
|
||||||
|
|
||||||
|
Anonymous function can be defined in a method body.
|
||||||
|
|||||||
Reference in New Issue
Block a user