Re: New "maxstatements" feature suggestion
- Posted by CChris <christian.cuvier at agriculture.gouv.fr> Jun 09, 2007
- 668 views
Pete Lomax wrote: > > Alan Oxley wrote: > > > > Being serious for a minite > > Ask yourselves this question, honestly please: > > If the maxstatement feature was already there, would you never use it? > > Erm, yes! (I would NEVER use it!). > Quite obviously, within my little baby Edita, there are some routines that say > 800 calls are serious brew a cuppa/watch a film/hope it is finished by the > time > I wake up, and some where 10,000,000 *must* happen while I blink. > > You ain't ever gonna better manual "for i=1 to maxstatement do" wrappers. > > Regards, > Pete While you are definitely right, I think Eu lacks some features that would be very helpful during development and testing, but would have to be diabled in actual code as they'd affect performance. We already have profiling. Things like maxstatements, assertions and other would be useful, as long as they can be turned off at will, because of that speed issue. That's how Eiffel works, for example. Specifically, loops there have optional "variant" and "invariant" clauses. "invariant" is a boolean expression that causes an exception if checked wrong on iteration start. "variant" is an integer expression which should decrease between iterations starts and remain positive, else bombs out. The clauses are optional, and even if you code them, they do something only if assertion checking is turned on at the highest level. Otherwise, they just act as comments - comments that do something when you turn them on. And turning them on is done in a control file, so there's no code editing and forgetting to comment/uncomment. I really love that aspect of the language. Just an idea of things Eu could usefully borrow. CChris