News for hackers. Stuff that matters.
Re:Python's Mutable Default Problem by perlgeek on Sunday February 20, 2011 @12:07PM (#2242331)
FWIW, Perl 6 implicitly treats default values as closures, and calls them when no argument is passed that could bind to the optional argument.

That way you get a fresh array each time, and you can even use defaults that depend on previous arguments:

    sub integrate(&integrand, $from, $to, $step = ($to - $from) / 100) { ... }

There are no comments on this comment yet.