Sanirim istediginiz isi `shadow` fonksiyonu yapiyor. Hakkinda cok
okumadim ama asagidaki gibi deneyince sanki oldu:
* #'car
#<FUNCTION CAR>
* (shadow 'car)
T
* #'car
debugger invoked on a UNDEFINED-FUNCTION in thread #<THREAD "initial
thread" {A7BE401}>:
The function CAR is undefined.
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT] Exit debugger, returning to top level.
(SB-INT:EVAL-IN-LEXENV #'CAR #<NULL-LEXENV>)
0] 0
* (defun car () "heyhey")
CAR
* (car)
"heyhey"
Haldun.
Volkan YAZICI wrote:
Merhaba,
Bildiğim kadarı ile FLET lexical scope'ta geçerli oluyor. Şöyle ki:
(defun cons-test (p q)
(cons p q))
(defun mapcar-test (proc lst)
(if (null lst) '()
(cons-test (funcall proc (first lst))
(mapcar-test proc (rest lst)))))
(flet ((cons-test (p q) (cons 1 (cons p q))))
(mapcar-test #'(lambda (p) (* p 2)) '(1 2 3 4)))
=> '(2 4 6 8)
MAPCAR-TEST, FLET tarafından tanıtılan CONS-TEST'i dikkate almadı. Bu
sebeple özellikle fonksiyonların dynamic scope'ta değerini nasıl
gölgeleyebileceğimizi sormuştum.
İyi çalışmalar.
_______________________________________________
cs-lisp mailing list
cs-lisp@cs.bilgi.edu.tr
http://church.cs.bilgi.edu.tr/lcg
http://cs.bilgi.edu.tr/mailman/listinfo/cs-lisp
_______________________________________________
cs-lisp mailing list
cs-lisp@cs.bilgi.edu.tr
http://church.cs.bilgi.edu.tr/lcg
http://cs.bilgi.edu.tr/mailman/listinfo/cs-lisp