Define a primitive data type: Difference between revisions
→{{header|Frink}}
(Frink) |
|||
Line 988:
=={{header|Frink}}==
Frink can set "constraints" on variables that must be enforced at all times. One way is to define a function that returns <CODE>true</CODE> if the constraint is met. This constraint is checked whenever assigning a new value to the variable.
<lang frink>oneToTen[x] := isInteger[x] AND x >= 1 AND x <= 10
|