What is the default return type?

Hey guys,

I’m trying to find out what is the default return type of a method /
function.

I read through some of the source code files but didn’t find the answer.
I know from other languages that the default return type is self (or
this) or last_expression.

Can someone tell me what type it is and where I can find it?

Thank you in advance

Avdi G. wrote:

The default return value is the value of the last statement executed
by the method.

Ok, what about:

def aMethod()
end

the return value would be nil? or nilclass, right?

On Thu, Jun 5, 2008 at 8:26 AM, Gog M. [email protected] wrote:
The default return value is the value of the last statement executed
by the method.


Avdi

Home: http://avdi.org
Developer Blog: http://avdi.org/devblog/
Twitter: http://twitter.com/avdi
Journal: http://avdi.livejournal.com

def foo;end
=> nil

foo
=> nil

I think you mean return value. The default return value is nil.

Hi –

On Thu, 5 Jun 2008, Gog M. wrote:

the return value would be nil? or nilclass, right?
It’s nil.

David

Dave B. wrote:

I think you mean return value. The default return value is nil.

jap, sorry. I was a little bit confused :slight_smile:

Thank you for your replies.
Can anyone tell me where in the C-files this is specified?
Thanks again