Re: E patches for review: ELoader, FileGetter
Kevin Reid <kpreid-M/[email protected]>
| Newsgroups | gmane.comp.lang.e.general |
|---|---|
| Message-ID | <[email protected]> |
On May 24, 2010, at 15:29, Thomas Leonard wrote: > Is Traceln DeepFrozen? If not, how do you debug DeepFrozen objects? > If so, what prevents the compiler optimising it out? The current answer is "It is or should be, and the compilers aren't that smart yet." Another option would be to make DeepFrozen permit references to traceln as a special case in the auditor, but that would produce probably-safe but bizarre inconsistencies. It's probably better to, when necessary, make special cases for debugging *in the compiler* rather than in the DeepFrozen auditor. A third option: define the interface for traceln such that it is included in the application data flow, so *could* have side effects and therefore may not be optimized out just by being DeepFrozen; this is similar to the approach Haskell takes (trace is a function which takes a message and a value, prints the message, and returns the value). I think this would be too unnatural to the user. -- Kevin Reid <http://switchb.org/kpreid/>