local M="\083\121\109\098\111\108"local n={}n.__index=n function n.new(e,a)assert(e~=nil,"\083\121\109\098\111\108 \073\068 \099\097\110\110\111\116 \098\101 \110\105\108")if a~=nil then assert(n.Is(a),"\083\099\111\112\101 \109\117\115\116 \098\101 \097 \083\121\109\098\111\108 \111\114 \110\105\108")end local F=setmetatable({ClassName=M,_id=e,_scope=a},n)return F end function n.Is(M)return type(M)=="\116\097\098\108\101"and getmetatable(M)==n end function n.IsInScope(M,e)return n.Is(M)and M._scope==e end function n.__tostring(M)return("\083\121\109\098\111\108\060\037\115\062"):format(M._id)end return n
--[[

	symbol = Symbol.new(id: string [, scope: Symbol])

	Symbol.Is(obj: any): boolean
	Symbol.IsInScope(obj: any, scope: Symbol): boolean

--]]

local CLASSNAME = "Symbol"

local Symbol = {}
Symbol.__index = Symbol

function Symbol.new(id, scope)
	assert(id ~= nil, "Symbol ID cannot be nil")
	if scope ~= nil then
		assert(Symbol.Is(scope), "Scope must be a Symbol or nil")
	end
	local self = setmetatable({
		ClassName = CLASSNAME,
		_id = id,
		_scope = scope,
	}, Symbol)
	return self
end

function Symbol.Is(obj)
	return (type(obj) == "table" and getmetatable(obj) == Symbol)
end

function Symbol.IsInScope(obj, scope)
	return (Symbol.Is(obj) and obj._scope == scope)
end

function Symbol:__tostring()
	return ("Symbol<%s>"):format(self._id)
end

return Symbol
