Smylers wrote:
Oh. I'd been assuming that quote marks indicated strings, and that,
while a string containing only digits could obviously be treated as a
number (as in Perl 5), it wouldn't be one without being provoked.
Correct.
What about:
$x = '0345';
Is that a number?
Nope. A string (un
Luke wrote:
I think you're forgetting what language you're talking about. Those are
numbers. After this statement:
$x = '345';
C<$x> is a number.
I don't think so. C<$x> is, of course, a variable. And what it contains after
that statement will depend on whether the variable is explicitly
Smylers wrote:
sort {$_.key} (1=> 'a', 10 => 'b', 2 =>'c');
There is nothing in the signature of the key-extractor to suggest that
all the keys are numbers, but as it turns out they all are.
Are they? I'd been presuming that pair keys would always be strings
Nope.
> and that the C<< => >>
Uri wondered:
DC> No. C<< &infix:<=> >> is the name of the binary C<< <=> >> operator.
so how is that allowed there without a block?
A Code object in a scalar context yields a Code reference.
Damian
Joe Gottman asked:
How do you decide whether a key-extractor block returns number? Do you
look at the signature, or do you simply evaluate the result of the
key-extractor for each element in the unsorted list? For example, what is
the result of the following code?
sort {$_.key} (1=> 'a
Smylers writes:
> Luke Palmer writes:
>
> > After this statement:
> >
> > $x = '345';
> >
> > C<$x> is a number.
>
> Oh. I'd been assuming that quote marks indicated strings, and that,
> while a string containing only digits could obviously be treated as a
> number (as in Perl 5), it would
At 2:49 PM -0700 2/20/04, Luke Palmer wrote:
After this statement:
$x = '345';
C<$x> is a number.
No, it isn't. It's a string. Or, rather, it's a PerlScalar.
I should hope it would be treated as one during
multimethod dispatch.
I should certainly hope *not*. If so, it's a bug. We ought to go
Luke Palmer writes:
> After this statement:
>
> $x = '345';
>
> C<$x> is a number.
Oh. I'd been assuming that quote marks indicated strings, and that,
while a string containing only digits could obviously be treated as a
number (as in Perl 5), it wouldn't be one without being provoked.
>
Smylers writes:
> Joe Gottman writes:
>
> > sort {$_.key} (1=> 'a', 10 => 'b', 2 =>'c');
> >
> > There is nothing in the signature of the key-extractor to suggest that
> > all the keys are numbers, but as it turns out they all are.
>
> Are they? I'd been presuming that pair keys would alw
Joe Gottman writes:
> sort {$_.key} (1=> 'a', 10 => 'b', 2 =>'c');
>
> There is nothing in the signature of the key-extractor to suggest that
> all the keys are numbers, but as it turns out they all are.
Are they? I'd been presuming that pair keys would always be strings (as
for hashes in
Smylers writes:
> Luke Palmer writes:
>
> > Uri Guttman writes:
> >
> > > > "DC" == Damian Conway <[EMAIL PROTECTED]> writes:
> >
> > > DC> @sorted = sort {-M}=>{$^b cmp $^a} @unsorted;
> > >
> > > but there is no comma before @unsorted. is that correct?
> >
> > Yes. Commas may be
Luke Palmer writes:
> Uri Guttman writes:
>
> > > "DC" == Damian Conway <[EMAIL PROTECTED]> writes:
>
> > DC> @sorted = sort {-M}=>{$^b cmp $^a} @unsorted;
> >
> > but there is no comma before @unsorted. is that correct?
>
> Yes. Commas may be ommitted on either side of a block whe
It's open for proposals and such. Quoth the organizer:
the workshop is now officially announced and the Call for Papers has
started
http://www.sebastian-bergmann.de/InterpretedLanguages2004/
Look 'em up and put in a paper. Should be fun.
--
Dan
13 matches
Mail list logo