home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!noc.near.net!hri.com!snorkelwacker.mit.edu!ai-lab!life.ai.mit.edu!tmb
- From: tmb@arolla.idiap.ch (Thomas M. Breuel)
- Newsgroups: comp.object
- Subject: Re: objects and closures
- Message-ID: <TMB.92Nov11120914@arolla.idiap.ch>
- Date: 11 Nov 92 17:09:14 GMT
- References: <1992Oct27.205320.13271@twg.com> <9210302223.AA11001@cs.columbia.edu>
- <720756315@sheol.UUCP> <TMB.92Nov6185629@arolla.idiap.ch>
- <1992Nov10.115952.24035@syacus.acus.oz.au>
- Reply-To: tmb@idiap.ch
- Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle
- Perceptive)
- Lines: 28
- NNTP-Posting-Host: arolla.idiap.ch
- In-reply-to: ian@syacus.acus.oz.au's message of Tue, 10 Nov 1992 11:59:52 GMT
-
- In article <1992Nov10.115952.24035@syacus.acus.oz.au> ian@syacus.acus.oz.au (Ian Joyner) writes:
-
- tmb@arolla.idiap.ch (Thomas M. Breuel) writes:
-
- >As "goto" is more expressive than a "while" loop, so are closures more
- >expressive than objects.
-
- Can you explain what you mean here? The way I understand it (maybe I am
- reading your statment wrong) is that you can say that "goto" is more
- powerful than a "while" loop, as a goto can transfer control to any
- label in scope. Whereas the while loop is very restrictive, as it transfers
- control to one specific place in the program.
-
- By "expressive" I mean that I can "express more concepts with it"; I
- think that's the obvious and usual meaning of the term.
-
- "goto" not only lets me build while loops, but I also can build loop
- exits and local exception handling out of it. A more powerful form of
- "goto", namely "callcc", lets me build exception handling and
- nondeterministic choice facilities with backtracking (incidentally
- "callcc" requires closures).
-
- "closures" are more expressive than objects because not only can I use
- them to build objects, opaque, and abstract datatypes out of them, I
- can also use them for building control structures ("while", "for",
- "map", "reduce", "fold", etc.) and for building lazy data structures.
-
- Thomas.
-