proposed patch for PR 72 (method lookup in interfaces)
Per Bothner
per@bothner.com
Wed Nov 3 16:02:00 GMT 1999
Godmar Back <gback@cs.utah.edu> writes:
> The whole idea of using one union 'tree' to represent everything in
> the system seems like it came from a bunch of lisp programmers
> with no appreciation for types writing their first C program.
Yes, in retrospect having a 'union tree' for everything was probably
a mistake. It does have some advantages. Still, if you used C++
and inheritance (not an option, alas), you get the flexibility of
a common tree type, but can use subtypes to get better typechecking.
> But why, for instance, did I have to say CLASS_INTERFACE(TYPE_NAME(clazz))
> to determine whether "tree clazz" is an interface? Why wouldn't
> CLASS_INTERFACE(clazz) work? If types were used in a meaningful way,
> the compiler would have warned me. The compiler can be your friend.
Well, you can compile gcc with -DENABLE_CHECKING (which is set when
you configure with --enable-checking) to get run-time checking.
(Run-time here means when gcc is run.) This feature was added
relatively recently (in the last couple of years).
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/
More information about the Java
mailing list