[Types-sig] Re: evaluating '!'

Tim Peters tim_one@email.msn.com
Wed, 26 Jan 2000 15:46:27 -0500

[John Skaller]
> 	I get worried by _any_ decl, for two reasons: one, it
> introduces another compile time statement -- I'd like to get
> RID of the other one (global).
> Secondly, it isn't clear what the semantics are/should be. So
> I get worried a bit before Greg .. but agree that the complexity
> of an extended declaration sublanguage introduces additional
> uncertainties.

The inability to name what we're talking about can be seen as a benefit only
if we're so confused we're afraid to say anything <0.5 wink>.

The semantics are certainly vague at this point, but equally unclear for
both decl and type-assert.  Greg defines the latter's semantics by appeal to
the undefined "consistent", and later pushes that off in turn to the also
undefined (in the New World) semantics of the isinstance function.  Guido's
proposal gives concrete examples, but no general rules, and actually raises
more questions than pretends to give answers.

It's not even clear to me that, *however* enhanced, isinstance will be
appropriate for defining type-checking behavior (c.f. comments from you and
Guido about the (certain to you, plausible to Guido) necessity to
distinguish between subtyping and subclassing).

Still, if you're supernaturally comfortable with the semantics of "!"
already, here are plausible semantics for decl:  within the scope of

    decl var: typedecl

each textual instance of var behaves as if

    (var ! typedecl}

had been written instead (with obvious modifications for appearances of var
as a binding target), and there are a pile of undefined yet highly
attractive <wink> rules about when that will raise an error at compile-time.
IOW, toss out decl, and nothing gets easier "even in theory":  type-assert
alone raises the same issues.

At this point I think the easy stuff is behind us.  I'd suggest that, to
make progress, we pick someone else's brains rather than toss out our own
half-baked ideas at random.  Else it's Tower of Babel time now.  In the
absence of a better suggestion, I recommend basing further discussion on the
terminology and concepts from the nice survey paper Guido referenced in his

[Bruce96] Kim Bruce: Typing in object-oriented languages: Achieving
expressiveness and safety.

That's what I intend to do, although Real Life insists I vanish for about a
week ...