[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]
Trivial suggestion
- To: <michael>
- Subject: Trivial suggestion
- From: Ravi Pandya <ravi>
- Date: Wed, 12 Sep 90 10:06:15 PDT
- Cc: <xtech>
- In-reply-to: <Michael>,21 PDT <9009121052.AA01942@xanadu>
Date: Wed, 12 Sep 90 03:52:21 PDT
From: michael (Michael McClary)
> This is no great priority, but it would eliminate a dozen or two
> messages from the interface.
But it does so by substituting run-time type-checking for compile-time
type-checking.
Not exactly. In fact, CAST(Bar, OK(baz->fetchFoo())) could safely be
turned into a hard cast by some hypothetical optimizer if Bar is equal
to or a superclass of Foo (the return type of fetchFoo). If Bar is a
subclass of Foo, then the run-time type checking would be necessary
even if we had a getFoo method. Using OK(fetchFoo) instead of getFoo
merely avoids writing a zillion fetchX/getX pairs.
--ravi