CoercedSlot
From Erights
(Difference between revisions)
Kevin Reid (Talk | contribs) (fix markup and content of result guard) |
Kevin Reid (Talk | contribs) (document __optUncall behavior) |
||
Line 1: | Line 1: | ||
This is a module used by the [[guard-based auditing]] proposal, though it can stand alone. | This is a module used by the [[guard-based auditing]] proposal, though it can stand alone. | ||
- | [[CoercedSlot]]s implement the [[Slot]] protocol. | + | [[CoercedSlot]]s implement the [[Slot]] protocol. They hold a single value, and the guard it was coerced by; they are immutable. |
==Maker== | ==Maker== | ||
- | {{maker msgdoc|run| | + | {{maker msgdoc|run|3|<var>guard</var>, <var>specimen</var>, <var>ejector</var>|[[CoercedSlot]]}} |
Makes a CoercedSlot holding the result of <var>guard</var>.coerce(<var>specimen</var>, <var>ejector</var>). | Makes a CoercedSlot holding the result of <var>guard</var>.coerce(<var>specimen</var>, <var>ejector</var>). | ||
- | {{maker msgdoc|attempt| | + | {{maker msgdoc|attempt|2|<var>guard</var>, <var>value</var>|[[CoercedSlot]]}} |
As run/1 unless the guard ejects, in which case the resulting slot's guard will be [[Guard-based auditing|LostApproval]][<var>guard</var>]. | As run/1 unless the guard ejects, in which case the resulting slot's guard will be [[Guard-based auditing|LostApproval]][<var>guard</var>]. | ||
Line 17: | Line 17: | ||
{{instance msgdoc|getGuard|0||[[Guard]]}} | {{instance msgdoc|getGuard|0||[[Guard]]}} | ||
- | Returns | + | {{instance msgdoc|__optUncall|0||[[Portrayal]]}} |
+ | |||
+ | Returns a portrayal in terms of [[#attempt/1]]. | ||
[[Category:ELib specification]] | [[Category:ELib specification]] |
Revision as of 04:27, 8 November 2008
This is a module used by the guard-based auditing proposal, though it can stand alone.
CoercedSlots implement the Slot protocol. They hold a single value, and the guard it was coerced by; they are immutable.
Contents |
Maker
run/3
run(guard, specimen, ejector) :CoercedSlot
Makes a CoercedSlot holding the result of guard.coerce(specimen, ejector).
attempt/2
attempt(guard, value) :CoercedSlot
As run/1 unless the guard ejects, in which case the resulting slot's guard will be LostApproval[guard].
Protocol
getGuard/0
- Signature: getGuard() :Guard
__optUncall/0
- Signature: __optUncall() :Portrayal
Returns a portrayal in terms of #attempt/1.