Message from discussion
question about global labels in imcc
Newsgroups: perl.perl6.internals
Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.stanford.edu!nntp.perl.org
Return-Path: <chumps_53...@yahoo.com>
Mailing-List: contact perl6-internals-h...@perl.org; run by ezmlm
Delivered-To: mailing list perl6-intern...@perl.org
Received: (qmail 35930 invoked by uid 76); 19 Jan 2004 20:16:27 -0000
Received: from x1.develooper.com (HELO x1.develooper.com) (63.251.223.170) by onion.perl.org (qpsmtpd/0.26) with SMTP; Mon, 19 Jan 2004 12:16:27 -0800
Received: (qmail 19682 invoked by uid 225); 19 Jan 2004 20:16:25 -0000
Delivered-To: perl6-intern...@perl.org
Received: (qmail 19677 invoked by alias); 19 Jan 2004 20:16:24 -0000
Received: from web41408.mail.yahoo.com (HELO web41408.mail.yahoo.com) (66.218.93.74) by la.mx.develooper.com (qpsmtpd/0.27-dev) with SMTP; Mon, 19 Jan 2004 12:16:13 -0800
Message-ID: <20040119201611.71859.qmail@web41408.mail.yahoo.com>
Received: from [137.104.77.118] by web41408.mail.yahoo.com via HTTP; Mon, 19 Jan 2004 12:16:11 PST
Date: Mon, 19 Jan 2004 12:16:11 -0800 (PST)
Subject: question about global labels in imcc
To: perl6-intern...@perl.org
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Spam-Check-By: la.mx.develooper.com
X-Spam-Status: No, hits=2.3 required=7.0 tests=CARRIAGE_RETURNS,FROM_ENDS_IN_NUMS,SPAM_PHRASE_03_05 version=2.44
X-SMTPD: qpsmtpd/0.26, http://develooper.com/code/qpsmtpd/
Approved: n...@nntp.perl.org
From: chumps_53...@yahoo.com (Togos)
Hi.
In IMCC, how can I get the address of a label in a
different compilation unit? Is there a way to do this
at compile time? I've looked through the latest docs
but according to imcc/docs/parsing.pod, global labels
get stored in global variables that you must look up
at run time (yuck).
It seems that newsub does some magic regarding this,
as
.sub _main
# This doesn't work
set $I1, _baz
print "_baz: "
print $I1
print "\n"
_shindig:
# But this does
newsub $P1, .Sub, _baz
get_addr $I1, $P1
print "_baz (fancy): "
print $I1
print "\n"
exit 0
.end
.sub _main2
_baz:
exit 0
.end
outputs
_baz: -1
_baz (fancy): 136929824
Is there any way I can get that magic without having
to
actually create a new .Sub object?
thanks,
- TOGoS
__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus