Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;; a silly struct and two silly functions that use it:
- (defstruct person name)
- (defun print-hello (person)
- (let ((name (string-upcase (person-name person))))
- (format t "HI, ~A!" name)))
- (defun make-name-upcase (person)
- (let ((name (string-upcase (person-name person))))
- (setf (person-name person) name)))
- ;; first use case, name is just a string:
- (defvar bob (make-person "Bob"))
- (print-hello bob)
- (make-name-upcase bob)
- ;; change name to be an array of strings:
- (defvar bob (make-person (vector "Bob" "Featherstone")))
Add Comment
Please, Sign In to add comment