lisp - Using entities from parent function -


usually obvious use entities of parent function function called within parent function. if have,

(defun fun1(x)(let ((y nil))(fun2)))  (defun fun2 () (print y))) 

then (fun1 2) complains y. how use entities parent function child function, fun2 able access entities of let scope of f1.

you descritption , code wrong, i'll answer understanding want do.

to such thing need declare variable special:

(defun parent-fun (x)   (let ((y nil))     (declare (special y))     (child-fun x)))  (defun child-fun (x)   (declare (special y)) ;; without declatation it'll work   `(,x ,y))             ;; you'll warning   cl-user> (parent-fun '(a b c)) ((a b c) nil) 

Comments

Popular posts from this blog

c# - how to use buttonedit in devexpress gridcontrol -

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - System.FormatException' occurred in MongoDB.Bson.dll - XXX is not a valid 24 digit hex string -