News for hackers. Stuff that matters.
Re:Evil Ruby by judofyr on Wednesday January 23, 2013 @07:17AM (#5102683)
You can also do:

    NULL = Object.new.freeze
    def foo(bar = NULL)
      if bar.equal?(NULL)
        # default value
      end
    end
Re:Evil Ruby by Xylakant on Wednesday January 23, 2013 @07:27AM (#5102724)
right, that would work to. I'd still prefer the original solution since it avoids creating a magic constant.