Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!uunet!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.object Subject: Re: Continuations Message-ID: <7159@ficc.uu.net> Date: 30 Nov 89 18:22:46 GMT References: <2664@bingvaxu.cc.binghamton.edu> <9624@pyr.gatech.EDU> <1623@odin.SGI.COM> <99894@ti-csl.csc.ti.com> <1989Nov29.230331.19595@odi.com> Reply-To: peter@ficc.uu.net (Peter da Silva) Organization: Xenix Support, FICC Lines: 20 In article <1989Nov29.230331.19595@odi.com> dlw@odi.com writes: > It depends what you mean. It would certainly be possible to invent a > definition of a language that was like C, but also had the features > needed to do continuation-style programming. There is. It's called C. Almost. Seriously. All you need to do is have a bit of unportable code that mucks around in struct jmp_buf. Save the stack between here and there, do a setjmp to mark the end of the current stack, and then longjmp back to the saved spot. To continue, restore the saved stack and longjmp back to the mark. It would be advisable to write this code in assembly language :->. This would also give you the ability to add coroutines, threads, and all sorts of other good stuff. Let's call it ++C. -- `-_-' Peter da Silva . 'U` -------------- +1 713 274 5180. "The basic notion underlying USENET is the flame." -- Chuq Von Rospach, chuq@Apple.COM Brought to you by Super Global Mega Corp .com