CoercedSlot

From Erights

(Difference between revisions)
Jump to: navigation, search
(wrong name for ExitFunction)
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. They hold a single value, and the guard it was coerced by; they are immutable.
+
[[CoercedSlot]]s implement the [[Slot]] protocol.
==Maker==
==Maker==
-
{{maker msgdoc|run|3|<var>guard</var> :[[Guard]], <var>specimen</var>, <var>ejector</var> :[[ExitFunction]]|[[CoercedSlot]]}}
+
{{maker msgdoc|run|1|<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|2|<var>guard</var> :[[Guard]], <var>specimen</var>|[[CoercedSlot]]}}
+
{{maker msgdoc|attempt|1|<var>guard</var>, <var>value</var>|[[any]]<nowiki>[</nowiki>[[CoercedSlot]]|[[FinalSlot]]<nowiki>]</nowiki>}}
-
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 a FinalSlot with <var>value</var> is returned.
==Protocol==
==Protocol==
Line 18: Line 18:
Returns the guard that this slot's value was coerced, or otherwise approved, by.
Returns the guard that this slot's value was coerced, or otherwise approved, by.
-
 
-
=== __optUncall/0 ===
 
-
[[Miranda __optUncall|__optUncall]]() :[[Portrayal]]
 
-
 
-
Returns a portrayal in terms of [[#attempt/1]].
 
[[Category:ELib specification]]
[[Category:ELib specification]]

Revision as of 04:11, 8 November 2008

This is a module used by the guard-based auditing proposal, though it can stand alone.

CoercedSlots implement the Slot protocol.

Contents

Maker

run/1

run(guard, specimen, ejector) :CoercedSlot

Makes a CoercedSlot holding the result of guard.coerce(specimen, ejector).

attempt/1

attempt(guard, value) :any[CoercedSlot

As run/1 unless the guard ejects, in which case a FinalSlot with value is returned.

Protocol

getGuard/0

Signature: getGuard() :Guard

Returns the guard that this slot's value was coerced, or otherwise approved, by.

Personal tools
more tools