I think this deserves at least a compile time warning and also a strict pragma
to make it an error as it is most likely not what the programmer wanted.
--
Mark Biggar
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
> Ingo Blechschmidt skribis 2005-08-31 13:22 (+):
> > @array = $ar
On 8/31/05, Yuval Kogman <[EMAIL PROTECTED]> wrote:
> On Wed, Aug 31, 2005 at 04:56:25 -0600, Luke Palmer wrote:
>
> > (That is, lexically binding &prefix:<+> does not change things in
> > numeric context; only when there's actually a + in front of them)
>
> Unless you override &prefix:<+> ?
>
>
[EMAIL PROTECTED] skribis 2005-08-31 15:50 (+):
> I think this deserves at least a compile time warning and also a
> strict pragma to make it an error as it is most likely not what the
> programmer wanted.
I do not think that using a scalar in list context deserves a warning.
Juerd
--
http:
Ingo Blechschmidt skribis 2005-08-31 13:22 (+):
> @array = $arrayref; # really means
> @array = ($arrayref,); # same as
> @array = (); @array[0] = $arrayref; # thus
> say [EMAIL PROTECTED]; # always 1
> # Correct?
Hi,
@array = $scalar;# really means
@array = ($scalar,); # same as
@array = (); @array[0] = $scalar;
# Correct?
@array = $arrayref; # really means
@array = ($arrayref,); # same as
@array = ();
On Wed, Aug 31, 2005 at 04:56:25 -0600, Luke Palmer wrote:
> (That is, lexically binding &prefix:<+> does not change things in
> numeric context; only when there's actually a + in front of them)
Unless you override &prefix:<+> ?
sub foo (&prefix:<+>) { +1 }
--
() Yuval Kogman <[EMAIL PROTECT
Let me just clarify something that my intuition led me to believe:
sub foo(&infix:<+>) { 1 + 2 }
sub bar($a, $b) { say "$a,$b" }
foo(&bar); # "1,2"
That is, operator names can be lexically bound just like any other
name. Also, this doesn't have any affect on implicit coercions, e