On Thu, Sep 22, 2005 at 07:23:06 -0400, David Storrs wrote:
> 
> On Sep 22, 2005, at 3:08 AM, Luke Palmer wrote:
> 
> >On 9/22/05, Carl Mäsak <[EMAIL PROTECTED]> wrote:
> >>FWIW, to me it looks fairly intuitive. undef here means "don't alias
> >>the element, just throw it away"... gaal joked about using _ instead
> >>of undef. :)
> >Joked?  Every other language that has pattern matching signatures that
> >I know of (that is, ML family and Prolog) uses _.  Why should we break
> >that?
> 

> Because the way Carl has it is more consistent with Perl 5, from
> whence most of our users will be coming?

But not with MMD pattern matching stuff, since you are now allowed
to declare that a body behaves a certain way when receiving certain
values.. For example

        multi factorial (0) { 1 }
        multi factorial ($n) { $n * factorial($n -1) }

I find this approach much more intuitive than special casing the
behavior of certain values when they are used inside prototypes.

> Because 'undef' has a nice  visual weight, while '_' can all too
> easily disappear?

sub foo ($x, _, $y) { # i feel this has a big enough weigh
sub foo ($x, __, $y) { # even better

> Because  throwing away values is something that we probably
> shouldn't make too  easy?

It should be made very easy - this encourages reuse of calling code,
not only callee code.

-- 
 ()  Yuval Kogman <[EMAIL PROTECTED]> 0xEBD27418  perl hacker &
 /\  kung foo master: *shu*rik*en*sh*u*rik*en*s*hur*i*ke*n*: neeyah!!!!

Attachment: pgpvS8QCm9eql.pgp
Description: PGP signature

Reply via email to