domingo, 2 de octubre de 2011

Fastruby 0.0.11 released with support for retry, redo and foreach

Fastruby is a gem which allows to execute ruby code much faster than normal, currently in a state of transition between a spike and a usable gem, it is released when possible with incremental improvements.
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.git
git checkout v0.0.11
Or install it using gem install:
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