From: Gerard R. <g.r...@fr...> - 2009-05-05 05:55:21
|
Hello, the function : (defun f3 (s) (* 3 s)) works as expected. For example: (f3 5) -> 15 So I think that (symbol-value s) -> 5 during the call of the function f3. To verify that I rewrote the function f as follows: (defun f3 (s) (print (symbol-value 's)) (* 3 s)) and now (f3 5) gives: debugger invoked on a UNBOUND-VARIABLE in thread #<THREAD "initial thread" RUNNING {10029E5021}>: The variable S is unbound. 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. (F3 5) If I set the global variable s to 94 i.e. (defparameter s 94) (f3 5) -> 94 15 Why I can't display the symbol-value of the local variable s ? (during the call of the function f3) tia -- Gérard |