From bbaff0e0c204c2fab216f6501dc8c11b4425b4bc Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 4 Mar 2024 21:01:27 -0600 Subject: Ugghhhh totally not working --- eval2.lua | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 eval2.lua (limited to 'eval2.lua') diff --git a/eval2.lua b/eval2.lua new file mode 100644 index 0000000..02444b8 --- /dev/null +++ b/eval2.lua @@ -0,0 +1,39 @@ +--- lam.eval + +local eval = {} +local read = require "read" +local util = require "util" +local types = require "types" +table.unpack = table.unpack or unpack + +local Environment = + function (inner, outer) + -- an Environment is really just a lua table between symbols and + -- values. They can be nested for uh, closure reasons or + -- something. TODO: figure out how this intersects with + -- Namespaces or Symboltables or whatever. + local mt = { + __type = "Environment", + __index = outer, + } + return setmetatable(inner, mt) + end + +local Procedure = + function (params, body, env) + local proc = { + params = params, + body = body, + env = env, + } + local mt = { + __type = "Procedure", + __call = + function (self, ...) + end, + } + return setmetatable(proc, mt) + end + +--- +return eval -- cgit 1.4.1-21-gabe81