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

[perl #33092] IMCC sub/opcode invocation conflict

5 views
Skip to first unread message

Dave Brondsema

unread,
Dec 17, 2004, 5:12:44 PM12/17/04
to bugs-bi...@rt.perl.org
# New Ticket Created by Dave Brondsema
# Please include the string: [perl #33092]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=33092 >

If I define a sub as:

.sub print
.param string arg
print arg
.end


Then I cannot invoke it using the IMCC "short way":
print("hello")
because I get this error:
error:imcc:op not found 'print' (print<0>)

But I have to invoke it like this:
find_global $P0, "print"
$P0("hello")


--
Dave Brondsema : da...@brondsema.net
http://www.brondsema.net : personal
http://www.splike.com : programming
http://csx.calvin.edu : student org

Luke Palmer

unread,
Dec 17, 2004, 6:39:30 PM12/17/04
to perl6-i...@perl.org
Dave Brondsema writes:
> # New Ticket Created by Dave Brondsema
> # Please include the string: [perl #33092]
> # in the subject line of all future correspondence about this issue.
> # <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=33092 >
>
>
>
> If I define a sub as:
>
> .sub print
> .param string arg
> print arg
> .end
>
>
> Then I cannot invoke it using the IMCC "short way":
> print("hello")
> because I get this error:
> error:imcc:op not found 'print' (print<0>)

You can invoke it the "almost short way":

"print"("hello")

You can also define the sub like this:

.sub "print"
.param string arg
print arg
.end

Which is quite nice for compiler writers.

Luke

Dave Brondsema

unread,
Dec 17, 2004, 7:56:45 PM12/17/04
to parrotbug...@parrotcode.org

That looks really great, but when I try it in 0.1.1 (on Windows), I get:

error:imcc:parse error, unexpected '(', expecting '\n'

Leopold Toetsch

unread,
Dec 18, 2004, 8:19:19 AM12/18/04
to Dave Brondsema, parrotbug...@parrotcode.org
Dave Brondsema wrote:

>> "print"("hello")


>
> That looks really great, but when I try it in 0.1.1 (on Windows), I get:
>
> error:imcc:parse error, unexpected '(', expecting '\n'

You'd need latest from CVS, sorry.

leo

0 new messages