tags:

views:

121

answers:

3

I just came across an odd method in some Ruby code, and I'm wondering if I'm missing something fundamental. It looks like this:

def funny
  !funny
end

What would this possibly return?

+4  A: 

It would recurse until you got a stack overflow.

Brian
Isn't the verb 'recur'? Sorry for being anal ;)
tehblanx
That's what I thought too...
Matt Grande
I think theres a recursive-recursive joke in there somewhere about posting recursive stack overflows errors in questions referring to recursion on StackOverflow
Eoin Campbell
Yo dawg, I heard you like recursion and StackOverflow...
tehblanx
Its definitely !funny
Brian
+5  A: 

That would run recursively until you get a stack overflow.

alexn
That's what I thought too...
Matt Grande
+2  A: 

It is a method labelled as being funny, which then contains !funny or literally, "not funny".

It recurses until there is a stack overflow.

angryamoeba