Hello aristotle, hello all,
no good to hide away... *sigh*
From the keyboard of A. Pagaltzis [10.12.07,13:41]:
* shmem [EMAIL PROTECTED] [2007-12-10 12:55]:
Well, if we were to return an array reference instead of a hash
ref,
sub [EMAIL PROTECTED],shift}
works. Why does the shift
From the keyboard of A. Pagaltzis [09.12.07,21:50]:
* Marcus Holland-Moritz [EMAIL PROTECTED] [2007-12-09 21:20]:
We're all stuck at 21. :-)
Well, `bless`, `shift` or `$_[0]`, `{}`, [EMAIL PROTECTED], and one comma are
all inevitable. That's 15 characters in fixed strings alone. Then
* shmem [EMAIL PROTECTED] [2007-12-10 12:55]:
Well, if we were to return an array reference instead of a hash
ref,
sub [EMAIL PROTECTED],shift}
works. Why does the shift get executed before an array
reference is constructed - but not if a hashref is constructed
- from an array?
It
AP == A Pagaltzis [EMAIL PROTECTED] writes:
AP * shmem [EMAIL PROTECTED] [2007-12-10 12:55]:
Well, if we were to return an array reference instead of a hash
ref,
sub [EMAIL PROTECTED],shift}
AP In contrast, the hash constructors make a *copy* of the array,
AP and that copy
On Dec 10, 2007 3:53 AM, shmem [EMAIL PROTECTED] wrote:
Well, if we were to return an array reference instead of a hash ref,
sub [EMAIL PROTECTED],shift}
works. Why does the shift get executed before an array reference is
constructed - but not if a hashref is constructed - from an array?
No
On 2007-12-09, at 00:28:08 -0800, Michael G Schwern wrote:
Uri Guttman wrote:
i have two solutions of 33 and 24 chars so you have to beat those. the
longer one is amusing enough to show it later.
sub new [EMAIL PROTECTED],shift}
Was my first shot at 23. Then I figured I could knock
On Sunday 09 December 2007, Michael G Schwern (Michael G Schwern
[EMAIL PROTECTED]) wrote:
sub new [EMAIL PROTECTED],shift}
Was my first shot at 23. Then I figured I could knock off that range op...
my first shot was 23 also...
sub new{($a,@b)[EMAIL PROTECTED];[EMAIL PROTECTED],$a}
then i
MGS == Michael G Schwern [EMAIL PROTECTED] writes:
even better than just be a poorly written constructor is that it is
inside a 'factory' module that is inherited by 80 other modules!!
MGS If that's an example of poorly written code in your project,
MGS can I come work there? It at
rw == robert wilson [EMAIL PROTECTED] writes:
rw On Sunday 09 December 2007, Michael G Schwern (Michael G Schwern
rw [EMAIL PROTECTED]) wrote:
sub new [EMAIL PROTECTED],shift}
Was my first shot at 23. Then I figured I could knock off that range op...
rw my first shot was 23
On 2007-12-09, at 13:23:11 -0500, Uri Guttman wrote:
MGS == Michael G Schwern [EMAIL PROTECTED] writes:
MGS sub new {$a=shift;[EMAIL PROTECTED],$a}
MGS 21. And it's even strict clean. :)
that is nice. the other replies beat it though!
Nope, Michael's solution is just as short.
* Uri Guttman [EMAIL PROTECTED] [2007-12-09 19:25]:
* Michael G Schwern [EMAIL PROTECTED] writes:
sub new {
my $class = shift;
return bless( [EMAIL PROTECTED], $class );
}
my clean version is:
sub new {
my ( $class, %self ) = @_ ;
return bless \%self, $class ;
}
i
A. Pagaltzis wrote:
* Uri Guttman [EMAIL PROTECTED] [2007-12-09 19:25]:
i don't like using shift for args if i can help it.
Personally I *always* use `shift` for the invocant, but
assignment from [EMAIL PROTECTED] for all other parameters in all but a few
rare circumstances. So methods in
Uri Guttman wrote:
is there any guarantee of evaluation order in arg lists? will the
bless/splice always be executed before the pop?
I believe it is undefined, so it's not recommended that you do anything order
dependent in the argument list. But it is stable.
As implemented, complex
MGS == Michael G Schwern [EMAIL PROTECTED] writes:
MGS Uri Guttman wrote:
is there any guarantee of evaluation order in arg lists? will the
bless/splice always be executed before the pop?
MGS I believe it is undefined, so it's not recommended that you do
MGS anything order dependent
14 matches
Mail list logo