Lispeum Documentation
Lispeum is a Lisp-inspired language designed for the Astreum blockchain.
Features
- Inspired by the simplicity and elegance of Lisp.
- Currently supports the following example expressions:
(def numero 6)
– Define a variable.(+ 1 2)
– Add two numbers.
Supported Expression Types
- Symbol: Represents identifiers or variables.
- Integer: Arbitrary‑precision signed whole numbers.
- String: Text enclosed in double quotes.
- List: Ordered collection of elements enclosed in parentheses.
- Boolean: Logical value, either
true
orfalse
. - Function: Function with parameters and a body.
- Error: Error with a category, message, and optional details.
Integer
The Integer
type is arbitrary‑precision and represented in two’s‑complement form. It is the basis for arithmetic, comparison, and modular operations.
Arithmetic Operators
(+ a b …)
– Addition of any number of integers.
One argument performs absolute value:(+ -3)
→3
.(- a b …)
– Subtraction. With one argument it returns the negation:(- 5)
→-5
.(/ a b …)
– Exact integer division (raises an error if non‑exact or division by zero).(% a b)
– Remainder ofa
divided byb
;b
must not be zero.
Comparison Operators
(= a b)
– Returnstrue
ifa
equalsb
.(> a b)
–true
ifa
is greater thanb
.(< a b)
–true
ifa
is less thanb
.(>= a b)
–true
ifa
is greater than or equal tob
.(<= a b)
–true
ifa
is less than or equal tob
.(!= a b)
–true
ifa
is not equal tob
.