home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.arch:10547 comp.lang.misc:3551
- Newsgroups: comp.arch,comp.lang.misc
- Path: sparky!uunet!pipex!ibmpcug!exnet!dhd
- From: dhd@exnet.co.uk (Damon)
- Subject: Re: CLU break and continue (Was: Re: A challenge to the anti-goto)
- Message-ID: <BxGID2.8n9@exnet.co.uk>
- Organization: ExNet Systems Ltd Public Access News, London, UK
- References: <721054332.26680@minster.york.ac.uk> <1992Nov9.114323.22688@rdg.dec.com> <BRADLEY.92Nov9101822@marley.think.com>
- Date: Mon, 9 Nov 1992 16:12:37 GMT
- Lines: 39
-
- In article <BRADLEY.92Nov9101822@marley.think.com> bradley@marley.think.com (Bradley Kuszmaul) writes:
- >In article <1992Nov9.114323.22688@rdg.dec.com> jch@rdg.dec.com (John Haxby) writes:
- >
- > ...
- > It's not surprising that the Ada exception mechanism is similar to CLU's
- > since CLU is one of Ada's ancestors.
- >
- > CLU has two exception mechanisms for slightly different purposes. One
- > mechanism is for returning an exception from a procedure call: a procedure
- > can signal an exception to be caught by its caller (the exception is not
- > propagated up the procedure call stack) or by a generic handler for
- > unhandled exceptions. The other mechanism is a local form that allows a
- > block (eg in a loop or if-statement) to exit to an enclosing block.
- > Apart from the local/procedure-call difference the two mechanisms are
- > identical, although `signal' tends to be expensive and `exit' is simply
- > an unconditional branch. ...
- >
- >The signal is not as expensive as you might think. This is because the
- >exception is not propagated up the call stack. I remember descriptions of
- >two implementations of signal, both of which had the property that
- > - if the signal is not raised, there is zero runtime cost (e.g., to set up the
- > signal handler.
- > - if the signal is raised, only a few instructions need to execute to
- > figure out where the signal handler is and to jump to it.
- > - if the appropriate handler is not defined, it only takes a few more
- > instructions to figure out where the `failure' handler is and to jump to
- > it.
-
- I think the New Jersey implementation of ML also only takes a few
- instructions to get to an exception handler from the raising of the
- exception. I'm no expert on how NJML is implemented, so maybe someone
- out there could explain how ML does it...
-
- Damon
- --
- Damon Hart-Davis Internet: dhd@exnet.co.uk, d@hd.org
-
- PUBLIC ACCESS UNIX (Suns), NEWS AND MAIL FOR UK#5 PER MONTH. FIRST MONTH FREE.
- [1.34] Cheap Sun eqpt. UUCP news/mail feeds. Tel/Fax: +44 81 755 0077.
-