70 likes | 195 Views
Premenn é. (defparameter a) (defparameter a 10 "Globalna premenna a") (defvar b) (defvar b 7 "Globalna premenna b") (defvar b 12) (defun a+ () "pristup k premennej a" (incf a) a). Premenn é. (defun c? (c) c) (c? 9) c (let ((c 3) (d)) (setf d (+ c 1)) (list c d))
E N D
Premenné • (defparameter a) • (defparameter a 10 "Globalna premenna a") • (defvar b) • (defvar b 7 "Globalna premenna b") • (defvar b 12) • (defun a+ () "pristup k premennej a" (incf a) a)
Premenné • (defun c? (c) c) • (c? 9) • c • (let ((c 3) (d)) (setf d (+ c 1)) (list c d)) • c • (let* ((c 3) (d (+ c 1))) (list c d))
Premenné • (defun c? (c) (print c)) • (let ((c 3)) (print c) (let ((c 5)) (print c) (print (c? 7)) (print c)) (print c))
Premenné • (defparameter c 2) • (defun c? () (print c)) • (let ((c 3)) (print c) (let ((c 5)) (print c) (print (c?)) (print c)) (print c))
Premenné • a • (let () (print a)) • (let ((a 2)) (print a)) • a
Premenné • (setf z 9) • z • (let ((x 2)) (setf y 8)) • y
Premenné • (setf c! (let ((pocet 2)) #'(lambda () pocet))) • (funcall c!)