Skip to content
Browse files

More exact arity matching

  • Loading branch information...
1 parent 8753fc4 commit 99c9c2eb06465e3ff44c3dabc967107866099da2 @singpolyma committed Mar 17, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 rpnr-runtime.rb
View
4 rpnr-runtime.rb
@@ -51,9 +51,9 @@ def puts
# Handle multiple-airity methods being passed a list magically
def magic_send(message, arg)
arity = method(message).arity
- if arity < 1
+ if arity == 0
send(message)
- elsif arg.is_a?(Array) && arity > 1
+ elsif arg.is_a?(Array) && arity != 1
send(message, *arg)
else
send(message, arg)

0 comments on commit 99c9c2e

Please sign in to comment.
Something went wrong with that request. Please try again.