Re: No exceptions?



Jonathan Leffler wrote:

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!).

Don't forget the converse problem - there was a relation y at compile time that was removed before runtime; there's no way to generate a compile time exception for the unexceptionable, but there are not many ways of avoiding a runtime exception if the compile time y had defined attributes (was not a synonym of DEE or DUM). Obviously, you could reinterpret the entire program in the light of what you find at runtime, but then why bother with the compilation in the first place? Even within a single program, you could have a relation y available when it is first interpreted that is dropped by the time the statement referencing it is executed. So, some runtime exceptions are nigh-on unavoidable, I think.

As soon as one drops y, whatever references it must either be dropped or become unusable. Thus, as soon as one compiles a statement that references any such resource, one would get a compile-time error. Instead of generating a compile-time error when compiling some program, one would get a compile time error when one tries to invoke the program.
.



Relevant Pages

  • Re: creaping coupling......
    ... In C++ it would be trivial to break that source code dependency, ... When you compile a .java module, ... In Java and C# it's asserted at compile time. ...
    (comp.object)
  • Re: VB Compiler Warnings & other woes ...
    ... you will get this warning in vs 2005. ... > have a direct legacy language path of evolution to consider. ... >> compile time errors rather than runtime. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: No exceptions?
    ... time that was removed before runtime; there's no way to generate a compile time exception for the unexceptionable, but there are not many ways of avoiding a runtime exception if the compile time y had defined attributes. ... Thus, as soon as one compiles a statement that references any such resource, one would get a compile-time error. ... I think many products go to elaborate lengths and introduce arbitrary concepts to handle such cases, at least some of them try to prevent catalogue updates in a transaction (Jim Gray described a logical '2-phase' protocol for intension locks many years ago and I've seen it implemented and I've seen the complications that seem never to end due to the intricacy, for example a reversal of Jonathan's converse problem, a sequential transaction that references y and then deletes y's definition - what should happen if the reference is then referred to again? ...
    (comp.databases.theory)
  • Re: RAD vs. performance
    ... iterable object--whether or not the object is an array or list is ... return ret ... known at compile time. ...
    (comp.lang.misc)
  • Re: apparently undefined function called by macro
    ... However, as almost always in Common Lisp;), there are exceptions to this rules: Some top-level forms do indeed have effects at compile time. ... The reason is that you typically want to base subsequent code on your macro definitions, and the compiler must be able to completely macro-expand away these macro definitions as well. ... A system definition allows you to declare that one file of lisp code depends on some other file of lisp code. ...
    (comp.lang.lisp)