Skip to content

Commit

Permalink
added lisp
Browse files Browse the repository at this point in the history
  • Loading branch information
Dpbm committed Aug 20, 2024
1 parent 158ea68 commit 2157c7f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions terceiro-ano/lisp/hello.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(print "Hello, World!")
15 changes: 15 additions & 0 deletions terceiro-ano/lisp/list.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
(defun sum(l)
(reduce #'+ l)
)

(defun mul(l)
(reduce #'* l)
)

(defparameter numbers (list 1 2 3 4 5 6 7 8 9))

(print numbers)
(format t "~%first: ~d~%" ( first numbers ))
(format t "second: ~d~%" ( second numbers ))
(format t "sum: ~d~%" ( sum numbers ))
(format t "multplication: ~d~%" ( mul numbers ))

0 comments on commit 2157c7f

Please sign in to comment.