From: Edward Faulkner Date: 2006-02-08T05:35:36+09:00 Subject: Re: About Extending Systax --SUOF0GtieIMvvwua Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 08, 2006 at 03:54:39AM +0900, mental@rydia.net wrote: > You could use continutations. =20 Indeed. With continuations you can build your own try/finally that doesn't use the built in ruby begin/rescue at all: $cc_stack =3D [] # takes two procs def my_try(body, finally) if callcc {|cc| $cc_stack << cc} body.call $cc_stack.pop end finally.call end def my_throw $cc_stack.pop.call end You could play some tricks to get a nicer syntax, but that's the general idea. =20 -Ed --SUOF0GtieIMvvwua Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFD6QRRnhUz11p9MSARAprkAJ9+E/SD/6z7W8sZ0p3q80R/g4jo2gCfbQcY 6C5weh//FA3Jcgciw9XaF7g= =B4m1 -----END PGP SIGNATURE----- --SUOF0GtieIMvvwua--