Subject: Re: Functional programming
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 1999/11/11
Newsgroups: comp.lang.lisp
Message-ID: <80dh22$66s4f@fido.engr.sgi.com>
Tim Bradshaw  <tfb@tfeb.org> wrote:
+---------------
| * Fernando D Mato Mira wrote:
| 
| > *cough* The "_modern_Lisp_  moral equivalent" is to pass closures,
| > not global function names.
| 
| I thought there was just a whole thread about how this was actually a
| bad thing to do sometimes:
| 
|     (cons #'foo *hooks*)
| 
|     (defun foo ()
|      ;; oops
|       ...)
+---------------

Exactly. CL gives you the *choice* of binding lateness versus effeciency,
because "symbol-function" is in the language standard and is relatively
cheap, compared to "eval". I didn't mean to imply that CL *couldn't* pass
closures, or that it wasn't usually "the right thing", but only that
Scheme-the-standard doesn't give you a *choice* other than (presumably slow)
"eval", so passing closures is usually considered the "only right thing".

Having said that, of course, someone will chide me about how specific
*implementations* of Scheme give you "(global-defined-value <symbol>)"
[which, for Scheme, a Lisp-1, is the closest equivalent of "symbol-function"
and presumably as cheap] or the like, but I think we're talking mostly
about the standard-defined languages here, yes? Implementation extensions
don't count in such discussions.


-Rob

p.s. Due credit: "global-defined-value" is from MzScheme

-----
Rob Warnock, 8L-846		rpw3@sgi.com
Applied Networking		http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		FAX: 650-933-0511
Mountain View, CA  94043	PP-ASEL-IA