lambda-calc-1/examples/sandbox.txt
2025-01-20 13:40:51 -06:00

63 lines
989 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# comments
0
1
3.14159
# booleans are lambdas or values?
# well, if they're lambdas, then they're read by the init file?
# if they're user-defined, then what should comparisions return?
# maybe they just return what 'true' or 'false' would return in the \
given envronment?
# also keep in mind that if they're values, we'll need a builtin \
conditional switch function in addition to them.
# it's probably best if they're builtin lambdas, like '+' or '×'.
true
false
# an expression doesn't end until it could validly end:
λ
x:
x
# ends before the 2
2
(λ x: x)(2)
f <- λ x: x; f 2
# numerical operators exist and can curry ...somehow:
+
-
×
÷
+ 1
× 2
+ 1 1
× 2 2
× (+ 1 2) 3
fib <- 𝑌 λ f x: (≤ x 1) x (+ (f (- x 1)) (f (- x 2)))
fib 8
(𝑌 λ f x: (≤ x 1) x (+ (f (- x 1)) (f (- x 2)))) 10
((((( ((((( ((((( ((((( 1 ))))) ))))) ))))) )))))