On Apr 29, 5:00 pm, cban1 <[email protected]> wrote:
> I'm sure this is a trivial question, but I'm a java/C programmer and
> am not used to implicit returns.
>
> If I have a function:
>
> def check_range ( num )
> rng = 0..10
>
> rng.include?( num )
> end
>
> ... does check_range evaluate to true or false depending on whether
> 'num' is in the range (based on the last line of the function)?
>
try it :)
> Is the implicit return basically just "the last thing the function
> evaluated" ?
Yup
Fred
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---