1 / 6

Funkcie

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 ()

raanan
Download Presentation

Funkcie

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Funkcie • (defun y (x) "Funkcia Y" (print x)) • (y 10)

  2. 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)

  3. Funkcie • (defun zz () (print 1) (print 3)) • (defun zz () (print 1) (return-from zz 2) (print 3))

  4. Funkcie • (defun p* (x) (when (> x 0) (p* (- x 1)) (print '*)))

  5. 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)

  6. 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)

More Related