[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sc-devel] [3.2] suggestion: compiler directive for class library



On 11/21/07, James Harkins <jamshark70@xxxxxxxxx> wrote:
> Your counterargument assumes that an extension can mean one and only one
> thing: "this is critical functionality, and if its target class doesn't
> exist, it's a problem that you must deal with before going any further."

If you tried to subclass a non-existant class, it would be fatal.
This is the same level of error.

You would have to wonder why you were defining methods for a class
that doesn't exist.  I would expect that to be a compile failure.  any
language would do that.

What if you just mispelled the classname ?  you would expect the
compiler to fail so you could figure out why.


> What I'm saying is that there's a second type of extension, which isn't
> supported yet: "if you have the target class, you will need these extra
> methods, but if not, you won't miss them."


actually you are saying "if you have the target class, you will need
these extra methods, but if not, then here they are anyway and I'm
just going to turn off the warnings system for a few milliseconds so
as not to upset you.  if any other warnings happen during that period,
then sorry but you will never know"


> While I do see your perspective,
> I also must note that you haven't offered any sort of reason why the second
> is invalid.


> My proposal would not take away the first kind of extension. It would merely
> give the developer the choice of which kind a particular extension is
> supposed to be. You could have both kinds in the same file, even.

a pre-processor could say #IF-CLASS-EXISTS
but it couldn't do that until its already parsed all of the files and
assembled the class tree.

-cx