Re: [OT] Perl-ish perl vs. C-ish perl.
On Mon, Aug 01, 2005 at 04:21:08PM -0700, Junio C Hamano wrote: Noel Maddy [EMAIL PROTECTED] writes: (silly perl stuff) Please refrain from making this thread I know more Perl than you do; thank you. Sorry. Just trying to help, but suitably chastened. Thanks -- Time is an illusion. Lunchtime doubly so. -- Ford Prefect +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ Noel Maddy [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe git in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [OT] Perl-ish perl vs. C-ish perl.
On Tue, Aug 02, 2005 at 09:37:36AM -0700, Junio C Hamano wrote: Noel Maddy [EMAIL PROTECTED] writes: Please refrain from making this thread I know more Perl than you do; thank you. Sorry. Just trying to help, but suitably chastened. I realize that what you sent was not _too_ Perlish and being helpful. If you feel I overreacted, I am sorry; I _do_ think I did overreact, attempting to be preemptive. No, I don't think you overreacted. Well, maybe a _little_ bit. ;) I think you're focused on making git good (as in reliable and maintainable), and that strong focus is admirable. Your clarification on the expected developer profile, and how to target the code to those developers helps, too. For those of us who've spent years living in Perl, the idioms come much easier than those who are coming from other languages like C. But if the expected maintainers are not perl weenies (like me, I guess), then you're right, it's better to stay away from the more perl-y stuffy. Again, thanks. -- If we can't define the user experience of Windows so that all Windows machines operate the same way, then the Windows brand is meaningless. -- Bill Gates +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ Noel Maddy [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe git in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] Add git-send-email-script - tool to send emails from git-format-patch-script
On Sun, Jul 31, 2005 at 07:52:42PM -0400, Ryan Anderson wrote: On Sun, Jul 31, 2005 at 02:45:29AM -0700, Junio C Hamano wrote: Ryan Anderson [EMAIL PROTECTED] writes: ... Also you seem to be losing the ordering in @to and @cc by the use of uniquefying keys %to and keys %cc. I can not offhand tell if it matters, but you probably would care, at least for the primary recipients listed in @to array. Well, it was kind of annoying to see the same email address appear 2-3 times in the email, because of the way I pull in all the relevant emails from various places. So I really needed a way to cull the duplicates. I don't believe ordering is really significant in To: or Cc: lines, for really anyone. I could do soemthing like this, instead, I suppose: my @clean_to = (); my %dupe_check_to = (); foreach my $to_entry (@to) { if (!$dupe_check_to{Email::Valid-address($to_entry)}++) { push @clean_to, $to_entry; } } my $to = join(, , @clean_to); I just like the first one a little better (though, I can't really pin down why). Or, more simply (if perl'y): my %tmp; @to = grep { ! $tmp{Email::Valid-address($_)}++ } @to; ...although I'd probably defensively localize the temporary var: { my %tmp; @to = grep { ! $tmp{Email::Valid-address($_)}++ } @to; } -- Short-term expediency always fails in the long term. -- The Preacher at Arrakeen +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ Noel Maddy [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe git in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] Add git-send-email-script - tool to send emails from git-format-patch-script
On Mon, Aug 01, 2005 at 06:08:00PM -0400, Noel Maddy wrote: On Sun, Jul 31, 2005 at 07:52:42PM -0400, Ryan Anderson wrote: On Sun, Jul 31, 2005 at 02:45:29AM -0700, Junio C Hamano wrote: Ryan Anderson [EMAIL PROTECTED] writes: ... Also you seem to be losing the ordering in @to and @cc by the use of uniquefying keys %to and keys %cc. I can not offhand tell if it matters, but you probably would care, at least for the primary recipients listed in @to array. Well, it was kind of annoying to see the same email address appear 2-3 times in the email, because of the way I pull in all the relevant emails from various places. So I really needed a way to cull the duplicates. I don't believe ordering is really significant in To: or Cc: lines, for really anyone. I could do soemthing like this, instead, I suppose: my @clean_to = (); my %dupe_check_to = (); foreach my $to_entry (@to) { if (!$dupe_check_to{Email::Valid-address($to_entry)}++) { push @clean_to, $to_entry; } } my $to = join(, , @clean_to); I just like the first one a little better (though, I can't really pin down why). Or, more simply (if perl'y): my %tmp; @to = grep { ! $tmp{Email::Valid-address($_)}++ } @to; ...although I'd probably defensively localize the temporary var: { my %tmp; @to = grep { ! $tmp{Email::Valid-address($_)}++ } @to; } Duh. ENOCAFFEINE. my %tmp; @to = grep { ! $tmp-{$_}++ Email::Valid-address($_) } @to; -- Short-term expediency always fails in the long term. -- The Preacher at Arrakeen +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ Noel Maddy [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe git in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html -- The more people you rule over, the less an individual matters. +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ Noel Maddy [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe git in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html