Skip to content

Instantly share code, notes, and snippets.

@aweis aweis/fun.rb
Created Sep 28, 2012

Embed
What would you like to do?
Functional Ruby
#metaprogramming
class Array
def tail
head, *tail = self
return tail
end
def head
head, *tail = self
return head
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.