310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
|
self._store[i/8] = self._store[i/8] and not (1 << (i % 8))
end
end
set.bits = {}
set.idvmap = {}
for i,v in ipairs(tbl) do
set.idvmap[v] = i
set.bits[v] = quote var b: set b:clear() b:setbit(i, true) in b end
end
set.metamethods.__add = macro(function(self,other)
local new = symbol(set)
local q = quote var [new] new:clear() end
for i = 0, bytes - 1 do
q = quote [q]
new._store[i] = self._store[i] or other._store[i]
|
|
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
|
self._store[i/8] = self._store[i/8] and not (1 << (i % 8))
end
end
set.bits = {}
set.idvmap = {}
for i,v in ipairs(tbl) do
set.idvmap[v] = i
set.bits[v] = quote var b: set b:clear() b:setbit([i-1], true) in b end
end
set.metamethods.__add = macro(function(self,other)
local new = symbol(set)
local q = quote var [new] new:clear() end
for i = 0, bytes - 1 do
q = quote [q]
new._store[i] = self._store[i] or other._store[i]
|