Evaluation is now performed properly, mimicking Common Lisp, and basic defun and defmacro definitions are provided (automatically executed on startup)

This commit is contained in:
Emin Arslan
2025-10-14 22:26:00 +03:00
committed by Emin Arslan
parent 7105b2dd39
commit fb52fb03b6
3 changed files with 62 additions and 11 deletions

View File

@@ -19,6 +19,7 @@ type lisp_val =
that it receives all of its arguments completely unevaluated
in a compiled lisp this would probably make more of a difference *)
| LMacro of string * environment * lisp_val * lisp_val
| LUnnamedMacro of environment * lisp_val * lisp_val
| LQuoted of lisp_val
and environment = (string, lisp_val) Hashtbl.t list
@@ -59,7 +60,9 @@ let rec dbg_print_one v =
(dbg_print_one args)
| LFunction (name, _, args, _) -> pf "<function: '%s' lambda-list: %s>"
name (dbg_print_one args)
| LMacro (name, _, args, _) -> pf "<function '%s' lambda-list: %s>"
| LUnnamedMacro (_, args, _) -> pf "<unnamed macro, lambda-list: %s>"
(dbg_print_one args)
| LMacro (name, _, args, _) -> pf "<macro '%s' lambda-list: %s>"
name (dbg_print_one args)
| LQuoted v -> pf "<quote: %s>" (dbg_print_one v)
(*| _ -> "<Something else>"*)