Re: functions that deal with hash should be more liberal

2000-09-04 Thread Chaim Frenkel
"NT" == Nathan Torkington [EMAIL PROTECTED] writes: NT Casey R. Tweten writes: Wow. Now that, that, is lame. You're saying that keys() expects it's first argument to begin with a %? Why should it care what it's argumen begins with? NT The keys function changes its arguments' data

Re: functions that deal with hash should be more liberal

2000-08-22 Thread Tom Christiansen
I assure you that the number of people who get compile-time caught for writing keys or each $x[$i][$j] or pop or push $x[$i][$j] is *very* large. This is by far the most prevalent error that happens with data structures in apprentice and perhaps even journeymen perl programmers. Having the

Re: functions that deal with hash should be more liberal

2000-08-22 Thread John Porter
Casey R. Tweten wrote: sub func { return qw/KeyOne Value1 KeyTwo Value2/; } print "$_\n" foreach keys func(); Please. There are ways -- well, just one way -- to do this, even in perl5. print "$_\n" foreach keys %{{ func() }}; -- John Porter We're building the

Re: functions that deal with hash should be more liberal

2000-08-22 Thread Jerrad Pierce
In reply to your message from the not too distant future: next Monday AD Reply-to: [EMAIL PROTECTED] Return-receipt-to: [EMAIL PROTECTED] Organization: a) Discordia b) none c) what's that? Content-Typo: gibberish, charset=ascii-art Date: Tue, 22 Aug 2000 10:15:48 EDT From: Jerrad Pierce belg4mit

Re: functions that deal with hash should be more liberal

2000-08-22 Thread Casey R. Tweten
Today around 10:11am, John Porter hammered out this masterpiece: : Casey R. Tweten wrote: : : sub func { :return qw/KeyOne Value1 KeyTwo Value2/; : } : : print "$_\n" foreach keys func(); : : Please. There are ways -- well, just one way -- to do this, even in perl5. : : print

Re: functions that deal with hash should be more liberal

2000-08-22 Thread Tom Christiansen
Other than the issue of semantics (array is not list), I still have not seen: a) why this is the Wrong Thing Why what is the wrong thing? Why treating an immutable list as a mutable array is wrong? Because you can't change the length of a list -- it doesn't have an AV to update. If you want

Re: functions that deal with hash should be more liberal

2000-08-21 Thread Casey R. Tweten
Today around 3:34pm, Tom Christiansen hammered out this masterpiece: : Today around 11:48am, Tom Christiansen hammered out this masterpiece: : : : So basically, it would be nice if each, keys, values, etc. could all deal : : with being handed a hash from a code block or subroutine... : : : :

Re: functions that deal with hash should be more liberal

2000-08-21 Thread Tom Christiansen
: No. keys() expects something that starts with a %, not : something that starts with a . Wow. Now that, that, is lame. You're saying that keys() expects it's first argument to begin with a %? Why should it care what it's argumen begins with? You're just now figuring this out? Really? All

Re: functions that deal with hash should be more liberal

2000-08-21 Thread Nathan Torkington
Casey R. Tweten writes: Wow. Now that, that, is lame. You're saying that keys() expects it's first argument to begin with a %? Why should it care what it's argumen begins with? The keys function changes its arguments' data structure. keys resets the each iterator (see the documentation

Re: functions that deal with hash should be more liberal

2000-08-21 Thread Jonathan Scott Duff
On Mon, Aug 21, 2000 at 09:00:26PM -0400, Casey R. Tweten wrote: Today around 3:34pm, Tom Christiansen hammered out this masterpiece: : No. keys() expects something that starts with a %, not : something that starts with a . Wow. Now that, that, is lame. You're saying that keys() expects

Re: functions that deal with hash should be more liberal

2000-08-21 Thread Tom Christiansen
Today around 11:48am, Tom Christiansen hammered out this masterpiece: : So basically, it would be nice if each, keys, values, etc. could all deal : with being handed a hash from a code block or subroutine... : : In the current Perl World, a function can only return as output to : its caller a

Re: functions that deal with hash should be more liberal

2000-08-21 Thread Casey R. Tweten
Today around 11:48am, Tom Christiansen hammered out this masterpiece: : So basically, it would be nice if each, keys, values, etc. could all deal : with being handed a hash from a code block or subroutine... : : In the current Perl World, a function can only return as output to : its caller a