Forgot your password?
typodupeerror

Comment Re:Perl vs. Ruby: sigils (Score 1) 414

I have no problems with a sigil giving both the interpreter and myself scope information, and since Ruby is a very dynamic language without any sort of variable declarations I don't see how else the interpreter could determine scope, but if you never want to see the @ sign again, here you go...

class Klass Object
    # create instance variables @num1 & @num2,
    # instance accessors Klass#num1 & Klass#num2,
    # and instance mutators Klass#num1= & Klass#num2=
    attr_accessor :num1, :num2

    def add_nums
        var1 + var2 # note, these are method calls
    end
end

Slashdot Top Deals

If it has syntax, it isn't user friendly.

Working...