On 10/7/05, chromatic <[EMAIL PROTECTED]> wrote:\
> If I added a multisub for Array assignment so that assigning an integer
> value set the length of the array, would 97 be compatible with Array?

You're not allowed to overload assignment.

But you are allowed to overload coersion.  Essentially, every
expression gets a coerce:<as>($expr, $current_context) wrapped around
it (where these are optimized away when they do nothing).  If you
allow definition of these at runtime, there are two side-effects:

    1) No typechecking can ever take place in any form.
    2) No coerce calls can ever be optimized away.

These are very unfortunate.  So I'm inclined to say that you can't
overload coersion at runtime.

> Juerd writes:
> > Do remember that some programs run for weeks or months, rather than a
> > few seconds. It's nice to get all the certain failures during compile
> > time.

There is a tradeoff around typecheckers that bounce on either side of
the Halting program.  Either: There are programs you call erroneous
when they are not; or there are programs you call correct when they
are erroneous.  I get the impression that most of us want the latter
kind for annotations (in the absence of "use static").

Luke

Luke

Reply via email to