Re: Re: What's new in 2.5?
>>Btw, this scheme extends beyond out of range indexes. "ifx sqrt(x)=y then..."
>>> would just be a false conditional if x=-1.
>
>
> Perhaps I don't understand this, but aren't you talking about something
> which should really be handled with a try...catch type of construct?
Answer is: that's cleaner if the catch handler may resume program execution
after taking corrective action (this may or may not apply, and includes
clearing an exception flag or skipping an unsafe code block). The exact answer
strongly depends on the particular program layout.
The idea is: nil and false are definitely distinct logical concepts. However,
they share the property that none is true. Having the option to use this would
clarify coding.
Second idea: the runtime engine performs some checks of its own. Instead of
performing them a second time, just tell the interpreter how you want it to
react. I wouldn't advise making such a strategy a with+option: it must be a
case by case coder decision. And sometimes it may prove a very big mistake
indeed.
CChris
|
Not Categorized, Please Help
|
|