forth-stuff/Dictionary.tl

19 lines
357 B
Plaintext

local WordInfo = require("WordInfo")
local type Dictionary = record
contents: {string: WordInfo}
end
function Dictionary:define(word: string, info: WordInfo)
self.contents[word] = info
end
local dict_mt = {__index = Dictionary}
function Dictionary:new(): Dictionary
return setmetatable({contents = {}} as Dictionary, dict_mt)
end
return Dictionary