Skip to content

Instantly share code, notes, and snippets.

@godfat
Created October 14, 2014 10:53
Show Gist options
  • Save godfat/e635d7d06b49eae2ad31 to your computer and use it in GitHub Desktop.
Save godfat/e635d7d06b49eae2ad31 to your computer and use it in GitHub Desktop.
def f a={}, **b
[a, b]
end
# huh?
f({:a => 0}) # => [{}, {:a => 0}]
# as expected
f(0) # => [0, {}]
# as expected
f({:a => 0}, {:b => 1}) # => [{:a => 0}, {:b => 1}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment