in reply to Re^5: When every microsecond counts: Parsing subroutine parameters
in thread When every microsecond counts: Parsing subroutine parameters
Named parameters means I don't have to pass a string of undefs because one particular call doesn't use those parameters. APIs using positional parameters have a way of requiring difficult upgrade path.
I personally believe that named parameters can indeed be very useful. In this sense Perl 6 with its extremely complete and flexible sub signatures is fantastic. Perl 5 is also charming for the far reaching semantics it can get out of its very simple mechanism of parameter passing, allowing one to emulate named parameters.
However, as far as your remark about "a string of undefs" (I presume you really mean "list") is concerned, I would like to point out that while the fact that several commas "collapse" into one fits perfectly well into Perl's semantics, I have occasionally desired say $x,,,,$y to be a shortcut for $x,undef,undef,undef,$y.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: When every microsecond counts: Parsing subroutine parameters
by CountZero (Bishop) on May 18, 2008 at 17:36 UTC | |
by blazar (Canon) on May 19, 2008 at 18:53 UTC | |
|
Re^7: When every microsecond counts: Parsing subroutine parameters
by talexb (Chancellor) on May 18, 2008 at 16:52 UTC | |
by blazar (Canon) on May 19, 2008 at 18:08 UTC | |
by talexb (Chancellor) on May 19, 2008 at 18:57 UTC | |
by blazar (Canon) on May 19, 2008 at 19:35 UTC | |
by holli (Abbot) on May 19, 2008 at 19:25 UTC |