1 -- A reference id : object like a string but for reference ids
6 __eq
= function(op1
, op2
) return op1
.Value
== op2
.Value
end,
7 __le
= function(op1
, op2
) return op1
.Value
<= op2
.Value
end,
8 __lt
= function(op1
, op2
) return op1
.Value
< op2
.Value
end,
9 __tostring
= function(op
) return op
.Value
end
14 function r2
.RefId(value
)
15 assert(value
~= r2
) -- in case of r2:RefId(value)
16 if value
== nil then value
= "" end
17 local refId
= { Value
= tostring(value
) }
18 setmetatable(refId
, r2
.RefIdMetatable
)
22 function r2
.isRefId(value
)
23 return type(value
) == "table" and getmetatable(value
) == r2
.RefIdMetatable