From: Philip Potter <philip.g.pot...@gmail.com> > 2009/12/16 Shlomi Fish <shlo...@iglu.org.il>: > > On Tuesday 15 Dec 2009 17:14:25 Philip Potter wrote: > >> If evaluating a constant expression results in a runtime exception, > >> that runtime exception must happen at runtime, and not at compile > >> time. In general, it is the duty of an optimizer never to change > >> program behaviour, only performance. > >> > > > > But this is a case where the compiler evaluates a constant expression and it > > results in an exception. So it cannot store it as a folded constant on the > > side for the run-time place. As a result, it throws a compile-time error. > > Yes, it can't fold the constant. That's no excuse for changing the > behaviour of the program. What it should do is what I wrote in my > previous email -- replace it with code that raises a runtime exception > when executed -- ie a die "Illegal division by zero".
An exception that get's raised every time is not very ... exceptional. What it should do is what it did. Tell you you are doing something stupid. Jenda ===== je...@krynicky.cz === http://Jenda.Krynicky.cz ===== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/