Fix hello example
Change addition and multiplication to take any number of arguments
Add value types section to README
An awful programming language
4()
(44(444))
()
is Nil.This is a simple program that outputs "Hello, world!" It's minimally optimized, and could almost certainly be made much smaller.
(4((4444444)(4(444)(((444)44)4(((444)44)44))))((4444444)(4(((444)44)(44444)(44((444)(444)4)))(44((444)44))))(((444)44)((4444444)(4(((444)44)(44444)(44((444)(444)4)))(4444)))((444)(444)4))((4444444)((((444)44)44)(((444)44)4(444444444))(4(44444)((444)44))))((4444444)(4(444444444)(4444)))((4444444)(444444444))((4444444)((((444)44)44)(((444)44)4(444444444))(4(444)((444)44))))((4444444)((((444)44)44)(((444)44)4(444444444))(4(44444)((444)44))))((4444444)((((444)44)44)(((444)44)4(444444444))(4(4444)((444)(444)4))))((4444444)(4(((444)44)(44444)(44((444)(444)4)))(4444)))((4444444)(((444)44)4(4(4444444)((444)44))))((4444444)(4((444)44)(444444444))))
Four supports the following data types:
4
literal or from various operations.()
literal.ID | Operation | Description |
---|---|---|
0 | function declaration | Takes one expression as a parameter, and returns a callable function form of it. Functions can be used as operations. |
1 | multiply | Takes any number of values and multiplies them, ignoring nils. If passed zero values, returns nil. Strings can be multiplied by integers for repetition. |
4 | add | Takes any number of values and adds or concatenates them, ignoring nils. If passed zero values, returns nil. |
8 | divide | Divides two numbers. If either value is nil, returns nil. |
9 | character from string | Takes a string and an integer, returns the character at the given index in the given string as a string. |
12 | conditional | Takes three values. If the first value is 4, the second is returned, otherwise the third is returned. |
16 | subtract | Subtracts two numbers. If either value is nil, returns nil. |
24 | char code to string | Interprets a number as a Unicode codepoint. Returns a string. |
nil | get | Returns a function parameter by index. |