Re:Why I Like Ruby
by v_ on Friday July 16, 2010 @01:01AM
(#1520340)
unless the consequence itself is something that signifies the end of a basic block, like a break or a next or a return.
[ Parent
| on HN ]
Re:Why I Like Ruby
by brianto2010 on Friday July 16, 2010 @01:50AM
(#1520408)
backtrack = true unless consequence.signifies? :block_end
It doesn't seem that much harder to read.Unfortunately though you are potentially adding subtle bugs here which can only be caught at run time.
To avoid excessive test coverage it would be more pragmatic to do:
backtrack = (consequence.signifies? :block_end) ? false : true
But that's not as easy to read :(