This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: proposed patch for PR 72 (method lookup in interfaces)
- To: Godmar Back <gback at cs dot utah dot edu>
- Subject: Re: proposed patch for PR 72 (method lookup in interfaces)
- From: Per Bothner <per at bothner dot com>
- Date: 03 Nov 1999 16:02:12 -0800
- Cc: java-discuss at sourceware dot cygnus dot com
- References: <199911032316.QAA08462@faith.cs.utah.edu>
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/