User:Tetratrary/Sandbox
Jump to navigation
Jump to search
Alluvium is a programming language.
Operations
Operation | Description |
---|---|
`x y | Returns a stream where x is the head and y is the tail |
+x y | Returns x + y |
-x y | Returns x - y |
*x y | Returns x * y |
/x y | Returns floor of x / y |
=x y z w | If x = y, return z, otherwise return w |
'x y | If y = 0, return head of stream x, otherwise return 'x -y 1 |
(x y ...) | Groups however many operands together |
Example programs
Factorial
`(0 1) (+@0 1 *@1 +@0 1)
Fibonacci sequence
`(0 1) (@1 +@0 @1)
Hello, world!
'`(72 101 108 108 111 44 32 119 111 114 108 100 33) (@0 @1 @2 @3 @4 @5 @6 @7 @8 @9 @10 @11 @12) 0