Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
question about global labels in imcc
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Togos  
View profile  
 More options Jan 19 2004, 3:48 pm
Newsgroups: perl.perl6.internals
From: chumps_53...@yahoo.com (Togos)
Date: Mon, 19 Jan 2004 12:16:11 -0800 (PST)
Local: Mon, Jan 19 2004 3:16 pm
Subject: question about global labels in imcc
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dan Sugalski  
View profile  
 More options Jan 19 2004, 3:48 pm
Newsgroups: perl.perl6.internals
From: d...@sidhe.org (Dan Sugalski)
Date: Mon, 19 Jan 2004 15:31:26 -0500
Local: Mon, Jan 19 2004 3:31 pm
Subject: Re: question about global labels in imcc
At 12:16 PM -0800 1/19/04, TOGoS wrote:

>Hi.

>In IMCC, how can I get the address of a label in a
>different compilation unit?

Don't. The only way to transfer control to code in a different
compilation unit (arguably in a different sub in the same compilation
unit) is via invoke or one of its relatives.
--
                                         Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
d...@sidhe.org                         have teddy bears and even
                                       teddy bears get drunk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »