Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 1. Void manifests itself.
- void
- // 2. Iota - an intangible particle that can
- // be distinguished from void.
- iota := not void
- // 3. Boolean proposition is a iota of truthfulness.
- bool := iota
- true, false := bool
- not x :=
- x := bool
- -> x ?
- true -> false
- false -> true
- x and y :=
- x, y := bool
- -> x ?
- true -> y
- false -> false
- x or y :=
- x, y := bool
- -> x ?
- true -> true
- false -> y
- x xor y :=
- x, y := bool
- -> (x or y) and not (x and y)
- // 4. Int stands for a whole number.
- int ::
- int < int -> bool
- int > int -> bool
- int <= int -> bool
- int >= int -> bool
- int + int -> int
- int - int -> int
- int * int -> int
- int / int -> int
- int ^ int -> int
- int % int -> int // mod
- // 5. List is a sequence of propositions.
- item list ::
- append! item to list -> item
- list length -> int
- list[int] -> item
- list[int:int] -> item list
- item in list -> bool
- // 5. Real stands for a real number.
- real ::
- real < real -> bool
- real > real -> bool
- real <= real -> bool
- real >= real -> bool
- real + real -> real
- real - real -> real
- real * real -> real
- real / real -> real
- real ^ real -> real
- rounded real -> real
- floored real -> real
- sqrt real -> real
- // 6. Rune is a character.
- //
- // For any text encoding, there always
- // will be a finite set of characters
- // it assumes. Therefore, it's safe
- // to say any rune can be expressed as
- // as integer.
- //
- // Corresponding fact: UTF-8 codepoint
- rune := int
- // 7. String is a sequence of characters.
- string := rune list
Add Comment
Please, Sign In to add comment