The v0.0.13 release of fastruby make a little internal design improvement regarding translator class and the implementation of splat arguments and methods with optional arguments (see examples below)
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.13
gem install fastruby
New Features
- Support for definition of methods with variable number of arguments
- Support for splat arguments on method calls
Examples of code being supported
Multiple arguments and call with splat
require "fastruby"
fastruby '
class X
def foo(*array)
array.each do |x|
p x
end
end
def bar(*args)
foo(*args)
end
end
'
x = X.new
x.foo(1,2,3) # prints 1,2 and 3
x.bar(4,5,6) # prints 4,5 and 6
Remaining uncovered items on v0.0.13 release
- Configuration of signatures for methods with variable number of arguments (will be implemented for v0.0.14)
- Build-time type inference of splat arguments as Array type (will be implemented for v0.0.14)
- Optimization of splat callls, currently this calls are executing using normal rb_funcall2 (will be improved for v0.2.0)
- Optimization of calls to methods with variable number of arguments, currently are wrapped using rb_funcall (will be improved for v0.2.0)
No hay comentarios:
Publicar un comentario