develooper Front page | perl.perl6.internals | Postings from July 2002

[netlabs #801] [PATCH] PerlArray in scalar context

Thread Next
From:
Sean O'Rourke
Date:
July 11, 2002 22:54
Subject:
[netlabs #801] [PATCH] PerlArray in scalar context
Message ID:
rt-801-3747.1.49050552378824@netlabs
# New Ticket Created by  "Sean O'Rourke" 
# Please include the string:  [netlabs #801]
# in the subject line of all future correspondence about this issue. 
# <URL: http://bugs6.perl.org/rt2/Ticket/Display.html?id=801 >


This patch makes the following behave as it does in Perl 5:

@a = 1..3; @b = 1..3;
$x = @a + @b;		# x is 6 in Perl 5, undef in Parrot

The problem was that the math vtable methods were giving up if the other
side of the operator wasn't an int or a num.  So the current version of
PerlArray would make $x undef.  I'm not sure getting the other thing's int
value (as opposed to its num value) is the right thing, but it seems like
a reasonable guess.

/s


-- attachment  1 ------------------------------------------------------
url: http://bugs6.perl.org/rt2/attach/3747/3492/67a294/perlarray-711.patch


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About