https://dev.eiffel.com/index.php?title=Restrict_types_mail&feed=atom&action=historyRestrict types mail - Revision history2024-03-29T07:42:25ZRevision history for this page on the wikiMediaWiki 1.24.1https://dev.eiffel.com/index.php?title=Restrict_types_mail&diff=8832&oldid=prevJuliant at 02:08, 23 June 20072007-06-23T02:08:35Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 02:08, 23 June 2007</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">These two emails are from the ECMA mailinglist and written by Bertrand Meyer. Only the important parts are copied:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==First mail==</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==First mail==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div><code></div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div><code></div></td></tr>
</table>Julianthttps://dev.eiffel.com/index.php?title=Restrict_types_mail&diff=8825&oldid=prevJuliant at 01:56, 23 June 20072007-06-23T01:56:19Z<p></p>
<p><b>New page</b></p><div>==First mail==<br />
<code><br />
Restrict_list == restrict Interval_expression<br />
Interval_expression == Interval | "{" Interval Operator Interval "}"<br />
<br />
<br />
Interval == Explicit_interval | Implicit_Interval<br />
Explicit_interval == Class_type ".." Class_type<br />
Implicit_interval == Class_type | ">" Class_type | Class_type ">"<br />
<br />
Interval_operator == "+" | "-" | "*"<br />
<br />
Note that operators use full parenthesization so there is no ambiguity. Maybe <br />
parentheses would be better than braces.<br />
<br />
Instead of >T and T> we could use .. T and T .., i.e. allow omitting either <br />
but not both of the two Class_type in Explicit_interval.<br />
Having played with both I tend to like the ">" forms better but am not really <br />
sure.<br />
<br />
<br />
Semantics:<br />
<br />
An Interval_expression denotes a (possibly empty) subset of the types in the <br />
universe. T .. U is the set of all types that conform<br />
to T and to which U conforms. T is an abbreviation for T .. T. T> is an <br />
abbreviation for T .. NONE. >T is an abbreviation for ANY ..<br />
T. "+" is union, "-" set difference, "*" intersection.<br />
<br />
<br />
Examples:<br />
<br />
ANY .. NONE -- Fits all types<br />
ANY> -- Means the same<br />
>NONE -- Means the same<br />
T> -- T and conforming types<br />
>T -- Types conforming to T<br />
T .. U -- Types conforming to T and to which U conforms<br />
X .. Y -- Types conforming to X and to which Y conforms<br />
{T .. U} + {X .. Y} -- Types that satisfy any of the preceding two <br />
conditions<br />
{T .. U} - {X .. Y} -- Types that satisfy the first of those but not the <br />
second<br />
{T .. U} * {X .. Y} -- Types that satisfy both<br />
<br />
<br />
etc.<br />
<br />
a: T is an abbreviation for e.g. a: restrict {T>}.<br />
<br />
<br />
<br />
Comparison with last proposed notation:<br />
<br />
a1: ANIMAL restrict ANIMAL -- Previously accept <br />
{ANIMAL}: monomorphic<br />
a2: ANIMAL restrict ANIMAL> -- `restrict' clause is <br />
superfluous<br />
a3: ANIMAL restrict {ANIMAL> - ANIMAL} -- Strictly polymorphic.<br />
a4: ANIMAL restrict OCTOPUS> -- Previously accept {all <br />
OCTOPUS}<br />
a5: ANIMAL restrict {CAT> + OCTOPUS} -- Previously accept {all CAT, <br />
OCTOPUS}<br />
a6: ANIMAL restrict {ANIMAL> - CAT>} -- Previously reject {CAT}<br />
a7: ANIMAL restrict {FELINE> - {CAT .. SIAMESE}}<br />
-- No previous <br />
equivalent<br />
<br />
I don't have any good example with intersection.<br />
</code><br />
==Second mail contained conformance rule==<br />
<code><br />
T restrict S conforms to T restrict S' only if S is a subset of S'<br />
</code></div>Juliant