Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

YOU CHOOSE!

Name: Anonymous 2006-04-11 0:48

Java... or Python?

Name: Anonymous 2006-04-12 11:48

>>30
Your entire argument seems to be based on the idea that if you can't access a member directly as in foo.bar, you have to use a method that looks like foo.getBar().

Unfortunately your argument falls down pretty much instantly when you look at Ruby. In Ruby parentheses are purely for grouping; any time they're not required to override precedence, they can be left out. How does this relate to accessing objects? Well, lets say you have a class Point with members x and y. It might look like this:
class Point
    def x
        @x
    end

    def x= newX
        @x = newX
    end
   
    #methods for y omitted
end

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List