1 / 7

Understanding Variables and Functions in Lisp Programming

This text explores the use of variables and functions in Lisp programming, highlighting key concepts such as global and local variables, function definitions, and the manipulation of data. It presents examples of defining parameters, incrementing variables, and utilizing printing functions to display results. The text also demonstrates how to use conditional and list functions to manage data structures effectively, providing insights into the syntax and structure of Lisp code. The reader will gain a foundational understanding of how to work with variables and functions in Lisp.

Download Presentation

Understanding Variables and Functions in Lisp Programming

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

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

  3. Premenné • (defun c? (c) (print c)) • (let ((c 3)) (print c) (let ((c 5)) (print c) (print (c? 7)) (print c)) (print c))

  4. Premenné • (defparameter c 2) • (defun c? () (print c)) • (let ((c 3)) (print c) (let ((c 5)) (print c) (print (c?)) (print c)) (print c))

  5. Premenné • a • (let () (print a)) • (let ((a 2)) (print a)) • a

  6. Premenné • (setf z 9) • z • (let ((x 2)) (setf y 8)) • y

  7. Premenné • (setf c! (let ((pocet 2)) #'(lambda () pocet))) • (funcall c!)

More Related