From: Stig Hemmer
Subject: CPS in C
Date: 
Message-ID: <ekvhehx2gha.fsf_-_@pvv.ntnu.no>
·······@dino.dnsalias.com (Stephen J. Bevan) writes:
> Sure, I have some C code that uses CPS by allocating small structs

I tried to write some code that did CPS-like stuff in C.  
The important line was

  while(( p= (*((void *(*)()) p))()));

Having written this line, I was exhausted and never finished the rest
of the portable Scheme-to-C compiler this was supposed to become.

This should perhaps be called Continuation Returning Style.

Stig Hemmer,
Jack of a Few Trades.
From: Joe Marshall
Subject: Re: CPS in C
Date: 
Message-ID: <x%F69.143284$uj.205999@rwcrnsc51.ops.asp.att.net>
"Stig Hemmer" <····@pvv.ntnu.no> wrote in message ·······················@pvv.ntnu.no...
> ·······@dino.dnsalias.com (Stephen J. Bevan) writes:
> > Sure, I have some C code that uses CPS by allocating small structs
>
> I tried to write some code that did CPS-like stuff in C.
> The important line was
>
>   while(( p= (*((void *(*)()) p))()));
>
> Having written this line, I was exhausted and never finished the rest
> of the portable Scheme-to-C compiler this was supposed to become.
>
> This should perhaps be called Continuation Returning Style.

As is frequently the case with C, you have to cast everything to
void * to work around the truly deficient type language.