Path: utzoo!attcan!uunet!mcvax!enea!kth!draken!liuida!mikpe From: mikpe@mina.liu.se (Mikael Pettersson) Newsgroups: comp.lang.c Subject: Re: new do-while syntax Summary: Yes, you _can_ Keywords: continuations, longjmp() Message-ID: <1119@mina.liu.se> Date: 20 Dec 88 03:02:59 GMT References: <3049@arcturus> <864@calvin.EE.CORNELL.EDU> <1716@buengc.BU.EDU> <8562@alice.UUCP> Organization: CIS Dept, Univ of Linkoping, Sweden Lines: 41 In article <8562@alice.UUCP> ark@alice.UUCP (Andrew Koenig) writes: >[edited] >I can't use arbitrary statements with the comma operator: > do { > [read & munge & set status] > } while (status) { > for (i = 0; i < THINGSIZE; i++) > if (temp[i] != precious[i]) > printf ("munge changed element %d of line %d\n", i, count); > } Watch: #include ... jmp_buf kappa; do { [read & munge & set status] } while(status && (i=0, setjmp(kappa), iAs I said before, it's way too late to get anything like this >into C now. It's fun to think about, though. Agreed. BTW, I came up with the ideas for the above hack when I tried to figure out a way to implement an `expression language' by translating it to plain old C. It isn't pretty, but it would do if all you want is a quick and dirty implementation of the new language. -- Mikael Pettersson, Dept of Comp & Info Sci, University of Linkoping, Sweden email: mpe@ida.liu.se or ..!{mcvax,munnari,uunet}!enea!liuida!mpe