60 likes | 228 Views
Funkcie. (defun y (x) "Funkcia Y" (print x)) (y 10). Funkcie. (lambda (x) (print x)) ((lambda (x) (print x)) 10) (funcall #'(lambda (x) (print x)) 10) (setf xx #'(lambda (x) (print x))) (funcall xx 10). Funkcie. (defun zz () (print 1) (print 3)) (defun zz ()
E N D
Funkcie • (defun y (x) "Funkcia Y" (print x)) • (y 10)
Funkcie • (lambda (x) (print x)) • ((lambda (x) (print x)) 10) • (funcall #'(lambda (x) (print x)) 10) • (setf xx #'(lambda (x) (print x))) • (funcall xx 10)
Funkcie • (defun zz () (print 1) (print 3)) • (defun zz () (print 1) (return-from zz 2) (print 3))
Funkcie • (defun p* (x) (when (> x 0) (p* (- x 1)) (print '*)))
Funkcie • ((lambda (a b c) (list a b c)) 1 2 3) • ((lambda (&optional a b c) (list a b c)) 1 2 3) • ((lambda (&optional a (b 5) (c 7 c-sup)) (list a b c c-sup)) 1 2 3)
Funkcie • ((lambda (&key a b c) (list a b c)) :a 1 :b 2 :c 3) • ((lambda (&key (a 0) (b 6 b-sup) ((:c cc) 7 c-sup)) (list a b b-sup cc c-sup)) :a 1 :b 2 :c 3) • ((lambda (&rest a) (list a)) 1 2 3)