Michele Dondi skribis 2005-11-04 14:58 (+0100):
> Let me explain: we all know that Perl5 has a very simple parameter
> passing mechanism for subs and an even more rudimentary
> {prototyping,signature} mechanism that one actually seldom uses.

It is unused because it sucks. </blunt>

> With this simple mechanism one can implement or fake quite a lot of
> parameter passing paradigms.

And it is a lot of work to do so.

> for simple subs in Perl6 I will probably still use @_

You'd be a fool to do so, with the sole exception of list manipulation,
which at least in my codebase isn't used quite that much, and almost
never listens to the qualification "simple sub".

Compare:

    sub dosomething { @_[0] blah @_[1] }

    sub dosomething ($a, $b) { $a blah $b }

    sub dosomething { $^a blah $^b }

The @_ solution is really the most ugly and hard to type of the three
possibilities.

> err... that or the new pointy subs which are indeed so cool!

Cool, but probably not a good idea for named subs, if only for style.

    our &dosomething ::= -> $a, $b { $a blah $b }

Not really a winner in any perspective.

> Whatever, the new system by contrast seems to me to be at least 400%
> more complex, but it won't buy me 400% more functionality.

It will buy you 400% in saving typing, 4000% in less debubbing and
40000% in maintainability(==readability).

> But the new system is what? 10k% more complex? The question is: does
> this buy me all that 10k% more functionality, or would have been a
> _simpler_ design, say "only" 1k% more complex be enough?

I love the OO system, and although it adds to complexity, I believe the
functionality gained is much greater. However, I do not see why we need
to add three ugly operators for features that I suspect almost nobody
will use: .?, .* and .+


Juerd
-- 
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html 
http://convolution.nl/gajigu_juerd_n.html

Reply via email to