<div dir="ltr">Hi<div><br></div><div>Can someone explain the following:</div><div><br></div><div><div><div>? (let ((fn nil)) (dotimes (k 2) (push (lambda () (print k)) fn)) (dolist (f fn) (funcall f)))</div><div><br></div>
<div>2 </div><div>2 </div><div>NIL</div><div>? (let ((fn nil)) (dotimes (k 2) (let ((r k)) (push (lambda () (print r)) fn))) (dolist (f fn) (funcall f)))</div><div><br></div><div>1 </div><div>0 </div><div>NIL</div><div>? (defvar r 10)</div>
<div>R</div><div>? (let ((fn nil)) (dotimes (k 2) (let ((r k)) (push (lambda () (print r)) fn))) (dolist (f fn) (funcall f)))</div><div><br></div><div>10 ?????</div><div>10 ?????</div><div>NIL</div><div>?</div></div>
</div><div><br></div><div>Kind regards</div><div>Taoufik</div><div><br></div></div>