Jump to content

Anonymous recursion: Difference between revisions

Add APL
m (→‎{{header|REXX}}: added whitespace, used a template for the output sections.)
(Add APL)
Line 75:
FI;
</lang>
 
=={{header|APL}}==
 
APL has the symbol <code>∇</code> which calls the current function recursively.
Functions can be defined and then called in place without ever assigning them a name,
though they are not quite first-class objects (you can't have an array of functions for example).
 
<lang APL>fib←{ ⍝ Outer function
⍵<0:⎕SIGNAL 11 ⍝ DOMAIN ERROR if argument < 0
{ ⍝ Inner (anonymous) function
⍵<2:⍵
(∇⍵-1)+∇⍵-2 ⍝ ∇ = anonymous recursive call
}⍵ ⍝ Call function in place
}</lang>
 
 
=={{header|AppleScript}}==
2,114

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.