Skip to content

Commit

Permalink
Added support to function overloading
Browse files Browse the repository at this point in the history
  • Loading branch information
pbalduino committed Jul 23, 2011
1 parent 25ab526 commit f4d1410
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/anonymous_function_spec.rb
Expand Up @@ -26,6 +26,20 @@
@lucio.eval(code).should == 23
end

it 'execute declaration with two different signatures' do
code = '
(fun
([]
(42))
([x]
(+ x 12))
([x y]
(* x y)))'
@lucio.eval("(#{code})").should == 42
@lucio.eval("(#{code} 23)").should == 35
@lucio.eval("(#{code} 7 8)").should == 56
end

=begin
it 'without parameters' do
code = '
Expand Down

0 comments on commit f4d1410

Please sign in to comment.