Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!att!dptg!ulysses!andante!alice!ark From: ark@alice.UUCP (Andrew Koenig) Newsgroups: comp.object Subject: Re: code blocks (aka closures) Message-ID: <11011@alice.UUCP> Date: 3 Jul 90 17:24:31 GMT References: <12396@june.cs.washington.edu> <1112@carol.fwi.uva.nl> Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 22 In article , deutsch@parcplace.com (Peter Deutsch) writes: > Andrew Koenig's post did a nice job of demonstrating the value and power of > closures. However, I find I disagree with his analysis of why they are not > appropriate for C or C++. Actually, I stopped just short of saying they were inappropriate. They are problematic, though, and I think we agree on some of the reasons why. Algol 68 has similar problems, if I remember correctly. > Closures can be implemented with absolutely no overhead for places that > don't use them, and relatively low overhead for places that DO use them. I won't repeat your description of the technique here, but I will say that it looks like a nice one. It does have one disadvantage, and that is that there are some machines that do not allow the program counter to point into data space. Also, it is presumably necessary to create these little pieces of code for those stack frames that need them. -- --Andrew Koenig ark@europa.att.com