Higher-order functions: Difference between revisions

m
 
(One intermediate revision by one other user not shown)
Line 542:
 
p doit ->add 1 2 #prints 3</syntaxhighlight>
 
=={{header|Bruijn}}==
Everything in bruijn is a function (including strings and numbers), so even <syntaxhighlight lang="bruijn">main [0]</syntaxhighlight> would be a valid solution since the argument of <code>main</code> is already a functional encoding of stdin.
 
A more obvious example:
<syntaxhighlight lang="bruijn">
first [0 [[0]]]
 
second [first [[1]]]
 
:test (second) ([[[[0]]]])
</syntaxhighlight>
 
=={{header|Burlesque}}==
Line 1,605 ⟶ 1,617:
[[File:Fōrmulæ - Higher-order functions 11.png]]
 
Since the '''Apply twice''' function returns a function, it can be immediately invoked:
 
[[File:Fōrmulæ - Higher-order functions 12.png]]
 
[[File:Fōrmulæ - Higher-order functions 11.png]]
 
It can also take a pure symbol, in order to retrrieve a symbolic result:
 
[[File:Fōrmulæ - Higher-order functions 13.png]]
 
[[File:Fōrmulæ - Higher-order functions 14.png]]
 
=={{header|GAP}}==
2,120

edits