Improved type system

This commit is contained in:
Eduard Urbach 2025-02-17 14:31:47 +01:00
parent 78f2670553
commit 6eab48c586
Signed by: eduard
GPG key ID: 49226B848C78F6C8
62 changed files with 189 additions and 172 deletions

View file

@ -1,16 +1,15 @@
import mem
import sys
number(x Int) {
length := 20
buffer := mem.alloc(length)
address, count := itoa(x, buffer, length)
number(x int) {
buffer := mem.alloc(20)
address, count := itoa(x, buffer)
sys.write(1, address, count)
mem.free(buffer)
}
itoa(x Int, buffer *Any, length Int) -> (*Any, Int) {
end := buffer + length
itoa(x int, buffer []int8) -> (*any, int) {
end := buffer + len(buffer)
tmp := end
digit := 0