"Gavin Sinclair" <gsinclair / soyabean.com.au> wrote:
>
> >
> > puts "Hello World"
> > i = 0
> > callcc do | $goto160 |
> >   callcc {| $goto120 |}
> >   $goto160.call if i > 10     # 120;
> >   puts "Current i: %d" % [i]
> >   i = i + 1
> >   $goto120.call
> > end
> > puts "Done!"                  # 160;
> >
> >
> > daz
>
>
> Did you test this?  I didn't, but it appears to me that it will loop
> forever.  Although you put "i = i + 1", when yyou then "goto 120", won't
> the previous value of i be restored, as the continuation's tentacles reach
> in to the consciousness of the program and find that moment in time?
>
> Gavin
>

I did.  It's a 'copy' of Rudolf's program.
The output seemed too bland to post :)

Hello World
Current i: 0
Current i: 1
Current i: 2
Current i: 3
Current i: 4
Current i: 5
Current i: 6
Current i: 7
Current i: 8
Current i: 9
Current i: 10
Done!


daz