FinalSlot

From Erights

(Difference between revisions)
Jump to: navigation, search
(Created page. Is there anything more to add?)
(replaced with spec-style doc)
Line 1: Line 1:
-
FinalSlot is an [[Slot]] that aquires its value at creation/definition time and there after always returns that value.
+
[[FinalSlot]] is the type of [[slot]] which underlies a [[final pattern]]. It is [[PassByCopy]]; it is given its value when it is created and cannot be assigned.
-
The :final guard checks if the slot passed is an FinalSlot.
+
Maker FQN: <code>org.erights.e.elib.slot.makeFinalSlot</code>
-
An anology for people that design computer hardware is that defining an FinalSlot is akin to manifacture an ROM containing the
+
The FinalSlot guard is parameterizable with a guard for the value; e.g. <code>makeFinalSlot(1) :FinalSlot[float64] => &lt;&amp; 1.0></code>
-
specified data.
+
 
 +
== Maker protocol ==
 +
 
 +
=== asType/0 ===
 +
{{asType|FinalSlot}}
 +
 
 +
=== run/1 ===
 +
run(value :any)
 +
 
 +
Makes a FinalSlot with the specified value.

Revision as of 15:29, 25 March 2008

FinalSlot is the type of slot which underlies a final pattern. It is PassByCopy; it is given its value when it is created and cannot be assigned.

Maker FQN: org.erights.e.elib.slot.makeFinalSlot

The FinalSlot guard is parameterizable with a guard for the value; e.g. makeFinalSlot(1) :FinalSlot[float64] => <& 1.0>

Maker protocol

asType/0

asType() :Guard

Returns the FinalSlot guard, which all products of this maker pass.

run/1

run(value :any)

Makes a FinalSlot with the specified value.

Personal tools
more tools