The v0.0.11 release of fastruby make internal improvements regarding non-local jumps and implements foreach support, including retry and redo statements (both applicable to any kind of block, and retry applicable on rescue clause)
Install
You can clone the repository at github:
git clone git://github.com/tario/fastruby.gitOr install it using gem install:
git checkout v0.0.11
gem install fastruby
New Features
Examples of code being supported
For each with redo and retry
require "fastruby"
fastruby '
class X
def foo
sum = 0
for i in (4..8)
p i # 4 4 4 4 4 5 6 7 4 5 6 7 4 5 6 7 4 5 6 7 8
sum = sum + i
redo if sum < 20
retry if sum < 100 and i == 7
end
sum
end
end
'
x = X.new
x.foo # 46
No hay comentarios:
Publicar un comentario