On Mon, Aug 22, 2005 at 10:51:25AM -0600, Eric wrote:
: Just my two cents then back to lurking. The idea of having named parameters
: with different names than the variables ++. Otherwise your public API is
: dependent on private variables which is a Bad Thing and the only thing that
: realy bugged me about current named parameters in P6.
:
: BTW why is it that just because they are defined as named they can't be used
: positionaly as well?
Because then the named marker would be redundant with the ? marker, which
can already be supplied as named parameters, as can mandatory positionals.
: Guess you could always use your same positional to named magic for the
: positionals. Then the programmer is expliciting defining the order in case
: the cases they want to use ordered versus named.
:
: multi sub seek ( $x, $y ) { seek( $:x, $:y) }:
: multi sub seek ( :x($horizontal), :y($vertical)) { ... };
Which would mean that :x() doesn't imply named-only, so we'd still need
a separate marker for that. But that seems like the wrong default.
And you can always alias the variable at the top of the body if you're
desperate for a different name than the public interface. Also, we'd
have to look at how these things degrade in partially specified stubs:
sub mystery { :x($), +:y(Dog @ where Beagle) }
It looks like it could get messy. Er, messier.
Larry