Subject: Re: (SETF (FUNCTION FOO) (FUNCTION BAR)) ?
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 23 Nov 2000 01:30:37 GMT
Newsgroups: comp.lang.lisp
Message-ID: <8vhrvt$to0q$1@fido.engr.sgi.com>
Barry Margolin  <barmar@genuity.net> wrote:
+---------------
| Rainer Joswig  <joswig@corporate-world.lisp.de> wrote:
| >Question: can I set a local function binding in Common Lisp?
| 
| No.
+---------------

Hunh? What's FLET all about then?

	> #'car
	#<SYSTEM-FUNCTION CAR>
	> (car '(a . b))
	A
	> (flet ((car (n) (+ 1 n)))
	    (values #'car (car 17)))
	#<CLOSURE CAR (N) (+ 1 N)> ;
	18
	>

And don't tell me I didn't shadow the right one, either:

	> (symbol-package 'car)
	#<PACKAGE LISP>
	> (flet ((lisp:car (n) (+ 1 n)))
	    (lisp:car 17))
	18
	>


-Rob

-----
Rob Warnock, 31-2-510		rpw3@sgi.com
Network Engineering		http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		PP-ASEL-IA
Mountain View, CA  94043