Re: No exceptions?



paul c wrote:
Bob Badour wrote:
...
The way to avoid exceptions is to treat them as compile-time errors.

I take it you really mean "ONE way to avoid exceptions ...". For one
thing, I am interested in being able to express "x join y" in advance of
defining a header for "x" (and I would like to evaluate it as well if
that is logically possible!).

When you say "in advance of" do you mean earlier in the source
file, or earlier in execution?

Earlier in the source file might be accomodatable; this would just
be a foward reference, and could be handled by the language
implementation making two (or more) passes over the source
before moving forward, which is not uncommon.

If you mean, earlier in execution, then you could certainly
permit it. You could allow partial evaluation; that is, you
make the result be a thunk which has no value yet, but
which will automatically convert in to a value once the
header becomes defined.

I'm not clear what problem you're trying to solve, though.
If it is elimination of exceptional conditions, that's not
exactly possible. Consider: read two numbers from
the input line and divide. The use enters "0, 0". Now,
you can certainly define *some* semantics for this,
but however you slice it, you have a partial function
that was invoked with values outside of the domain
it is defined on.


Marshall

.