From: Robert Dober Date: 2006-12-12T22:47:30+09:00 Subject: Re: Bug in Ruby or Pickaxe? ------=_Part_70134_33038523.1165931247476 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 12/12/06, Dave Thomas wrote: > > > On Dec 12, 2006, at 4:10 AM, Robert Klemme wrote: > > > I have low expectations with regard to the "else" clause but the > > book clearly states that it is executed if there was no exception - > > that includes the case where the block is left via a "return". > > Behavior and description simply are not in sync, that's my point. > > > Interesting: I'd honestly never have thought of that interpretation. > I guess in my mind, the semantics of return take precedence over most > other semantics, and I explicitly note the times where that's not the > case. Thanks for pointing out an alternative. > > Do you feel I should also document the other places when a return > could be issued? For example, in the description of a while loop, I > say "executes body zero or more times as long as boolean-expression > is true." Should I add "or a return is executed or an exception is > thrown" to this and similar descriptions? > > I kind of feel that this would clutter the descriptions, and that > most readers would make the assumption that return and exceptions > would break the flow. Is that an incorrect assumption? Maybe the assumption is wrong in some, maybe even many cases, but I believe you should keep this one as simple as possible, at this very point. While explaining "while" you might not want to confuse newbies, and more advanced readers might satisfy your assumption more likely anyway. The structurally more complicated stuff like raise, ensure and do not forget nonlocal jumps (aka continuations) should be explained elsewhere and I believe it is exactly at that elsewhere point where one might explain the impacts on the more basic constructs. This is just a great piece of work and I think it is about perfect as it is now, well maybe I should read it after all ;) Regards > > > Dave > > > Robert (D not K) -- "The real romance is out ahead and yet to come. The computer revolution hasn't started yet. Don't be misled by the enormous flow of money into bad defacto standards for unsophisticated buyers using poor adaptations of incomplete ideas." - Alan Kay ------=_Part_70134_33038523.1165931247476--