News for hackers. Stuff that matters.
Re:Moment of Ruby: An Argument for Nothing by lucasluitjes on Friday November 06, 2026 @09:29AM (#50392711)
Nice, though I think I'd rather do:

  def a *args
    if args.empty? 
      @setting
    else
      @setting = args.first
    end
  end
Re:Moment of Ruby: An Argument for Nothing by zemptime on Friday November 06, 2026 @11:48AM (#50394832)
this also works and reads nicely! tradeoff is, you allocate an array each time