* Juerd <[EMAIL PROTECTED]> [2006-09-20 22:25]:
> I think it's time we moved away from the param method, and
> started using a hash.
I don’t know about that. The `param` method has the nice property
that it allows you to pretend everything’s a single value or to
use multi-valued params, at your own discretion, at any time,
with no change of syntax.
my $foo = $q->param( 'foo' );
my @bar = $q->param( 'bar' );
If you tried to do this with a hash, you’d get
my $foo = $q->param->{ 'foo' }[0];
# my ( $foo ) = @{ $q->param->{ 'foo' } };
my @bar = @{ $q->param->{ 'bar' } };
You could try making the type of the value depend on arity and be
either a scalar or an arrayref, but then you get V*E*R*Y U*G*L*Y
client code that needs to constantly check whether it’s dealing
with one or the other.
Does Perl 6 offer any help in making access to a HoL look like
the first example? If not, then no, let’s please stick with the
`param` protocol.
Regards,
--
Aristotle Pagaltzis // <http://plasmasturm.org/>