News for hackers. Stuff that matters.
Re:Take the Arc Challenge by derefr on Monday February 04, 2008 @02:14AM (#108998)
Just as an aside about your Ruby example:

    (condition && string).to_s

    (string if condition).to_s
both work (though the first fails when passed false instead of nil.) I use something similar in quick-and-dirty Ruby shell scripts:

    n_to_generate = (ARGV.shift || "0").to_i

There are no comments on this comment yet.