18 lines
504 B
Plaintext
18 lines
504 B
Plaintext
···
|
|
http://rosettacode.org/wiki/Anonymous_recursion
|
|
···
|
|
⟦import java.util.function.UnaryOperator;⟧
|
|
|
|
■ AnonymousRecursion
|
|
§ static
|
|
▶ main
|
|
• args⦂ String[]
|
|
if 0 > Integer.valueOf args[0]
|
|
System.out.println "negative argument"
|
|
else
|
|
System.out.println *UnaryOperator⟨Integer⟩° ■
|
|
▶ apply⦂ Integer
|
|
• n⦂ Integer
|
|
⏎ n ≤ 1 ? n ! (apply n - 1) + (apply n - 2)
|
|
°.apply Integer.valueOf args[0]
|