subtyping (was: Re: [E-Lang] Operators #2: Comparison)
Mark S. Miller
markm@caplet.com
Sat, 07 Apr 2001 12:36:26 -0700
--=====================_169329637==_.ALT
Content-Type: text/plain; charset="us-ascii"
At 06:57 AM Saturday 4/7/01, zooko@zooko.com wrote:
>Hm. Note that you are assuming nominative typing here instead of structural.
>It is nominative because it is based on typed declared by the programmer.
I'm glad you raised that, because E hasn't taken a stance on this issue, and
isn't ready to. There are good arguments on both sides.
>Unless we really need to specify this behaviour now, I would suggest leaving it
>until later, when we'll have a better idea of what we want.
Agreed. "type op__cmp(type)" is hereby withdrawn. Turns out it conflicts
with another use of op__cmp that we'd agreed to, but which I forgot to list.
For example, we agreed that
integer < 3
(rather than the current "any < 3") should be the way to form the region of
all integers less than three.
So, for those types whose instances respond to op__cmp, and for which one
can form regions representing non-enumerable sets of these instances, we
consider these types to also represent the coordinate-space in which these
instances are positions, where the type-as-coordinate-space provides the
following region formation operators:
space < positionX -> region of all positions in space < positionX
and similarly for the other comparison operators. Note that the region
float64 <=> 0.0
evaluates to the singleton region containing all positions equivalent to
0.0. This includes both 0.0 and -0.0, but the region is still considered a
singleton region.
Likewise
float64 <=> NaN
evaluates to the empty region of float64s, not a singleton region, since no
positions in this space are equivalent to NaN.
Cheers,
--MarkM
--=====================_169329637==_.ALT
Content-Type: text/html; charset="us-ascii"
At 06:57 AM Saturday 4/7/01, zooko@zooko.com wrote:
Hm. Note that you are
assuming nominative typing here instead of structural.
It is nominative because it is based on typed declared by the
programmer.
I'm glad you raised that, because E hasn't taken a stance on this issue,
and
isn't ready to. There are good arguments on both sides.
Unless we really need to specify
this behaviour now, I would suggest leaving it
until later, when we'll have a better idea of what we
want.
Agreed. "type op__cmp(type)" is hereby withdrawn.
Turns out it conflicts
with another use of op__cmp that we'd agreed to, but which I forgot to
list.
For example, we agreed that
integer < 3
(rather than the current "any < 3") should be the way to
form the region of
all integers less than three.
So, for those types whose instances respond to op__cmp, and for which one
can form regions representing non-enumerable sets of these instances, we
consider these types to also represent the coordinate-space in which
these
instances are positions, where the type-as-coordinate-space provides the
following region formation operators:
space < positionX -> region of all
positions in space < positionX
and similarly for the other comparison operators. Note that the
region
float64 <=> 0.0
evaluates to the singleton region containing all positions equivalent to
0.0. This includes both 0.0 and -0.0, but the region is still
considered a
singleton region.
Likewise
float64 <=> NaN
evaluates to the empty region of float64s, not a singleton region, since
no
positions in this space are equivalent to NaN.
Cheers,
--MarkM
--=====================_169329637==_.ALT--