Re: [PATCH 00/16] git-send-email cleanups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sep 30, 2010, at 10:52 AM, Jeff King wrote:

> They don't necessarily do what you want:
> 
>  perl -e 'sub want_scalar($) { print "got $_[0]\n" }
>           want_scalar("ok");
>           my @a = qw(totally broken);
>           want_scalar(@a);
>  '
> 
> I get:
> 
>  got ok
>  got 2
> 
> And using "sub want_list(@)" basically does nothing at all (you can pass
> nothing, a scalar, or a list).

I'm not surprised by that at all, but I've spent too much time in scripting languages recently.

> For more details, read:
> 
> http://www.perlmonks.org/?node_id=861966
> 
> (If you're impatient, skip to the section "Problems with Regular
> Prototypes").

Huh.  Somewhere along the way I had picked up using prototypes as a solution to some problem and got used to them.  Interesting to see the full discussion why you shouldn't.  I guess I'm reading too much Ruby and Perl6 and didn't think about how that would work with Perl5.

~~ Brian

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]