An experiment in parentheses-free lisp (in JavaScript)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

19 lines
262 B

def square
(lambda a -> (a * a))
def pow
(lambda base exp ->
(base ^ exp))
def powed (pow (2 + 3 * 5) 2)
def squared (square powed)
def fact
(lambda n ->
if (n == 0)
then 1
else
(n * (fact (n - 1))))
def main (print (fact 15))