home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / misc / 2745 < prev    next >
Encoding:
Internet Message Format  |  1992-08-20  |  2.3 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!mips!sdd.hp.com!hpscdc!hplextra!otter.hpl.hp.com!hpltoad!toad.hpl.hp.com!dg
  2. From: dg@polly.dgupta.hpl.hp.com (Dipankar Gupta)
  3. Newsgroups: comp.lang.misc
  4. Subject: Re: PL/1 non-local goto versus setjmp/longjmp Re: CISC Microcode
  5. Message-ID: <DG.92Aug20172716@polly.dgupta.hpl.hp.com>
  6. Date: 20 Aug 92 16:27:16 GMT
  7. References: <1992Aug12.073130.1@zodiac.rutgers.edu> <id.VJBS.0DK@ferranti.com> <mwm.1jk3@contessa.palo-alto.ca.us> <id.KTGS.0N5@ferranti.co
  8. Sender: news@hplb.hpl.hp.com (Usenet News Administrator)
  9. Organization: Hewlett-Packard Laboratories, Bristol, UK
  10. Lines: 45
  11. In-Reply-To: peter@ferranti.com's message of Tue, 18 Aug 1992 14:54:47 GMT
  12. Nntp-Posting-Host: polly.hpl.hp.com
  13.  
  14. In article <id.KTGS.0N5@ferranti.com> peter@ferranti.com (Peter da Silva) writes:
  15.  
  16. [Elided]
  17.  
  18. | Basically, imagine integrating setjmp/longjmp with the language to a greater
  19. | extent. ...
  20.  
  21. [More elided]
  22.  
  23. | But putting it directly in the language, you allow for more optimizations.
  24. | By replacing goto, you clean up a messy part of the language without losing
  25. | any general capability (switches with good optimization and this context
  26. | can replace every use of goto).
  27.  
  28. [Stll more elided]
  29.  
  30. | Yes, you can build subroutine libraries that do this, but they're inherently
  31. | non-portable. This sort of thing should be part of the language, and is much
  32. | more important to me than expanding the type structure with object-oriented
  33. | stuff.
  34.  
  35. What you describe was generalised by Peter Landin in '65, who called
  36. it the J operator. It has been adopted, in particular, by languages
  37. like Scheme and ML which use it to define powerful control structures.
  38. (The FP/Lisp community calls it ``call with current continuation'' or
  39. call/cc).  For examples of the usages that you outlined, see the
  40. Scheme stream-based IO or the Cornell work on Concurrent ML.
  41.  
  42. Cheers,
  43. Dipankar Gupta
  44. Hewlett-Packard Laboratories
  45. Bristol UK
  46.  
  47. PS: I don't think that ML has continuations as a part of the Standard,
  48. but the New Jersey implementation provides call/cc as a first-class
  49. language element.
  50.  
  51. References:
  52. [1] Landin, P. A correspondence between Algol 60 and Church's lambda
  53. notation: Part 1 [C. ACM 8(2) pp89-101, Feb. 1965]
  54.  
  55. [2] Clinger, W and Rees, J (eds). Revised^4 Report on the Algorithmic
  56. Language Scheme.
  57. --
  58. --
  59.