4e63b62
Branches > main > 4e63b62 > files
add symbol tostring function
Commit: 4e63b62970ad45cd34b8d940ddef64543fac9a21
Parent: 064d762
1 changed file:
org/faddle/lang/symbol.lua view file
@@ -44,6 +44,18 @@ end end +local function str(sym)+ if is_symbol(sym) then+ if module(sym) then+ return module(sym) .. ":" .. name(sym)+ else+ return name(sym)+ end+ else+ error("Not a symbol")+ end+end+ -- Eventually munge these names. -- I guess table is referring to any table but perhaps it should refer strictly to an aliased module... -- Maybe should be 'module'@@ -65,4 +77,4 @@ -- local function munge(sym) end -- local function demunge(sym) end ? -return {is_symbol = is_symbol, intern = intern, is_valid_symbol = is_valid_symbol, name = name, module = module}+return {is_symbol = is_symbol, intern = intern, is_valid_symbol = is_valid_symbol, name = name, module = module, str = str}