Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Conversion of string to int (in PIR)

3 views
Skip to first unread message

Roger Browne

unread,
Jan 6, 2006, 7:59:42 AM1/6/06
to Perl 6 Internals
This PIR program:

.sub 'main' :main
print_as_integer('-4')
print_as_integer('X-4')
print_as_integer('--4')
.end

.sub 'print_as_integer'
.param string s
$I0 = s
print $I0
print "\n"
.end

produces this output:

-4
0
-4

I think the last line should be "0", but if anyone thinks that "-4" is
correct please say so before I report it as a bug...

Thanks.

Regards,
Roger Browne


Jerry Gay

unread,
Jan 6, 2006, 9:26:14 AM1/6/06
to Roger Browne, Perl 6 Internals
looks like a bug to me. please report it.
~jerry

Leopold Toetsch

unread,
Jan 6, 2006, 11:15:11 AM1/6/06
to Roger Browne, Perl 6 Internals

On Jan 6, 2006, at 13:59, Roger Browne wrote:

> This PIR program:
>
> .sub 'main' :main
> print_as_integer('-4')
> print_as_integer('X-4')
> print_as_integer('--4')
> .end

[ ... ]

> I think the last line should be "0", but if anyone thinks that "-4" is
> correct please say so before I report it as a bug...

Yup - fixed in r10938. Thanks for testing.

> Roger Browne

leo

Roger Browne

unread,
Jan 6, 2006, 11:53:46 AM1/6/06
to Perl 6 Internals
On Fri, 2006-01-06 at 17:15 +0100, Leopold Toetsch wrote:

> Yup - fixed in r10938. Thanks for testing.

OK, then please ignore that patch that I just sent. Thanks for the quick
work!

Regards,
Roger Browne

0 new messages