Auditor tagging
From Erights
(Difference between revisions)
Kevin Reid (Talk | contribs) |
(→Proposals) |
||
Line 36: | Line 36: | ||
* Change the return value of [[Auditor#audit/1]] and [[Miranda auditedBy|__auditedBy]] to be 'optTag :[[Data]]' instead of 'approved :[[boolean]]'. [http://www.eros-os.org/pipermail/e-lang/2008-March/012550.html] --[[User:Kevin Reid|Kevin Reid]] 10:10, 9 March 2008 (CDT) | * Change the return value of [[Auditor#audit/1]] and [[Miranda auditedBy|__auditedBy]] to be 'optTag :[[Data]]' instead of 'approved :[[boolean]]'. [http://www.eros-os.org/pipermail/e-lang/2008-March/012550.html] --[[User:Kevin Reid|Kevin Reid]] 10:10, 9 March 2008 (CDT) | ||
+ | |||
+ | * Distinguishing between null and other Data is a bit unclean, since null is also valid Data. Instead, how about if the annotation is either null or a FinalSlot containing Data. | ||
+ | --[[User:67.127.191.99|67.127.191.99]] 22:38, 13 March 2008 (CDT) | ||
==Discussion== | ==Discussion== |
Revision as of 03:38, 14 March 2008
It is possible for an auditor to tag an object with arbitrary data, by encoding it in a pattern of approvals by additional auditors (see code below).
Since this is possible, and could be useful, it should be made possible to do so without inefficient gimmicks.
def makeStamp() { return def stamp { to audit(_) { return true } } } def bits := accum [] for i in 0..!4 { _.with(makeStamp()) } def encodingAuditor { to audit(a :Audition) :boolean { def toEncode := (a.getSource().getOName() \ .getOptName().last() - '0') % (2**bits.size()) for i => bit in bits { if ((toEncode & (1 << i)) > 0) { a.ask(bit) } } return true } to retrieve(specimen :any) :int { var result := 0 for i => bit in bits { if (__auditedBy(bit, specimen)) { result |= (1 << i) } } return result } }
? def x7 implements encodingAuditor {} # value: <x7> ? encodingAuditor.retrieve(x7) # value: 7
Proposals
- Change the return value of Auditor#audit/1 and __auditedBy to be 'optTag :Data' instead of 'approved :boolean'. [1] --Kevin Reid 10:10, 9 March 2008 (CDT)
- Distinguishing between null and other Data is a bit unclean, since null is also valid Data. Instead, how about if the annotation is either null or a FinalSlot containing Data.
--67.127.191.99 22:38, 13 March 2008 (CDT)