From: Ryan Pavlik Date: 2003-06-07T01:44:16+09:00 Subject: Re: ANN: ruby-goto, your evil for the evening On Fri, 6 Jun 2003 20:56:57 +0900 Jim Weirich wrote: > This is great! But the really scary thing is that I was thinking about > doing something similar, but using continuations. The exception > implementation is much more straight forward (and much more evil ... > people expect weird things from continuations). Yeah... one thing I was trying to show at the time was the fact that goto was useful (in C) for things like exceptions and similar error handling (like unwind-protect) since the language sadly lacks both. This was just showing equivalence by going in the opposite direction, or something. ;) > The only changes I would suggested is using ... > > frame { > label(:lab) { ... } > ... > } > > instead of frame_start/frame_end (now you have your first evil change > request). I considered this, among other things (making it threadsafe for one). The frame{} way would probably be the best and take care of both problems, since it would eliminate the need for a global "frame stack". Although without that, I couldn't add support for long jumps... >;) There are other possibilities, like implicit frame_starts, but since I don't think this is likely to be used much, I didn't go to a whole lot of trouble. Maybe this weekend I'll release version negative two if I get a chance. ;) -- Ryan Pavlik "They be like a thorny thorn in ye sidey side." - 8BT