latest

Faddle · faddle.git · Tickets

Branches > main > latest > files

Update def error message when no module has been defined

Grahp, 2026-07-19

Commit: a62588bbc5d3806cde5b0af90c460e86d039db25
Parent: 21dffc2

1 changed file:

org/faddle/lang/eval.lua modified (view file)

@@ -29,7 +29,7 @@ -- And re-defining updates the var and calls its handler or whatever, or calls an update_var() idk, and it also updates the module table local function def(sym, args, env)   assert(is_symbol(sym) and not module(sym), "def must be called with a simple symbol")-  assert(modules[env.current_module] ~= nil, "Cannot define var in non-existent module '" .. env.current_module .. "'")+  assert(modules[env.current_module] ~= nil, "Cannot define var without being in a module.")   local val = eval(first(args), env)   -- Doesn't add to the return table right now   -- Probably want to munge names so they're easier to use from Lua.@@ -141,13 +141,13 @@   return require(mod) end --- So is this what loads core and alises? local function create_env(mod_name)   local env = {current_module = mod_name}   module_form(mod_name, env)   return env end +-- TODO is the interpreter going to be needed? eval = function(form, env)   if is_list(form) then     if count(form) == 0 then return form end