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
Message from discussion Continuation usage
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
 
Leopold Toetsch  
View profile  
 More options Mar 19 2004, 5:48 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Fri, 19 Mar 2004 11:10:12 +0100
Local: Fri, Mar 19 2004 5:10 am
Subject: Re: Continuation usage

Piers Cawley <pdcaw...@bofh.org.uk> wrote:
> Jens Rieks <par...@jensbeimsurfen.de> writes:
>> Hi,

>> does the attached test use the Continuation in a correct way?
>> The test failes, what am I doing wrong?
> Without running it I'm guessing that it prints out something like
> 456=789
> 456=456
> 123=123

Why would it print 3 lines?

> Easy.

Brrr.

> One part of your problem (The state of P16-18) is, therefore, a bug in
> your program. The other part seems to be a bug in the current
> implementation of Continuation.

Yep.

> A new Continuation should grab the current P1 continuation. If you
> later invoke that Continuation, it should make the jump and reset
> P1. Until that's done, all we have is a heavyweight goto.

I don't get that. Below is a stripped down version of Jens program. There
are 2 ways of invokeing the return continuation:

    invoke conti

or

    conti()

The former is more or less ignored by imcc, the latter is recognized as
a regular function call: registers are preserved and a flag
"sub_calls_a_sub" is set, so that e.g. the return continuation is
preserved around the call. These variants give different output.

How schould it really work?

.sub _main
    .local int a
    a = 1
    _func()
    print a
    print " main\n"
    end
.end

.sub _func
    .local pmc conti
    .local int a
    a = 4
    conti = newcont _end
    _do_something( conti )
_end:
    print a
    print " _func\n"
.end

.sub _do_something
    .param pmc conti
    .local int a
    a = 7
    # invoke conti      # (1)
    conti()             # (2)
    print "error!\n"
.end

Thanks,
leo


 
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.