What is the default return type?

G

Gog Mangog

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
 
G

Gog Mangog

Avdi said:
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?
 
G

Gog Mangog

Dave said:
I think you mean return value. The default return value is nil.

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


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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,667
Latest member
DaniloB294

Latest Threads

Top