Files
olisp/bin/comp.ml
Emin Arslan 4792a296d3
All checks were successful
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
ci/woodpecker/cron/debian Pipeline was successful
ci/woodpecker/cron/nix Pipeline was successful
ci/woodpecker/cron/fedora Pipeline was successful
ci/woodpecker/cron/publish Pipeline was successful
interpreter: minor fixes, changes to the main binary to actually interpret some source code
2026-03-22 17:23:49 +03:00

17 lines
502 B
OCaml

let ( let* ) = Result.bind;;
(* Try to interpret some test source code. *)
let some_source = "(define (+ a b) b)
(+ 1 2)";;
(* I don't have any built-in functions at all rn, so we just use a dummy function *)
let bruh =
let* res = Interpreter.Main.interpret_src some_source in
match res with
| Int x -> Printf.printf "got %d as result\n" x; Ok ()
| _ -> Printf.printf "got something else\n" ; Ok ()
let _ =
match bruh with
| Error s -> Printf.printf "%s" s
| _ -> ()