RE: Danger! Type-checking & the translator
- Posted by Andy Serpa <ac at onehorseshy.com> Jan 28, 2003
- 421 views
Robert Craig wrote: > OK, I'll try to do the following for 2.4. > It should only delay me a day or so. > > If you say "without type_check", > then you'll get absolutely no user-defined type checking > (interpreter or translator). > > If "with type_check" is in effect, > as it is by default, then translated code > will automatically call (i.e. on assignment) any types that > have side effects. All other type checks will be ignored > as they are now. I'm already keeping track of which routines > have side-effects - writing to a global variable, > poking into memory, doing I/O, calling another routine that > has side effects etc. So it becomes an optimization issue. > The Translator will optimize-out type calls that can > safely be removed, given that your program is supposed to be free > of type check errors when you use the Translator. > This should eliminate all "normal" type calls. > Calls that might involve side effects will be left in, and a report > will be issued if they generate a type check error. > Very good. When you say "report will be issued" that means crash, right? In other words, if I have a type call that is left in, and it returns 0 (False), I can count on it to abort at that point, correct? Of course, I can just put in an abort(), but just to be clear.