vm: got the VM to finally actually work
ci/woodpecker/push/debian Pipeline was successful
ci/woodpecker/push/nix Pipeline was successful
ci/woodpecker/push/fedora Pipeline was successful
ci/woodpecker/push/publish Pipeline was successful

This commit is contained in:
2026-04-25 22:48:06 +03:00
parent 5edcc974b6
commit 0925b44ef7
5 changed files with 87 additions and 31 deletions
+13 -6
View File
@@ -3,17 +3,24 @@
Stuff like printing to the screen, file I/O etc will be implemented
here.
*)
open Types
let builtin_print (v : value) =
ignore v;
Nil
let builtin_print (v : Types.value) =
let p = Printf.sprintf in
let rec aux_print = function
| Int x -> p "%d" x
| Double x -> p "%f" x
| String x -> p "\"%s\"" x
| Nil -> p "'()"
| Cons (a, b) -> p "(%s . %s)" (aux_print a) (aux_print b)
| Symbol x -> p "'%s" x
| Closure (i, _) -> p "<closure %d>" i
| Native i -> p "<native %d>" i in
print_endline (aux_print v);
Types.Nil
let table = [|
builtin_print
|]