diff --git a/terceiro-ano/lisp/hello.lisp b/terceiro-ano/lisp/hello.lisp new file mode 100644 index 0000000..e83d738 --- /dev/null +++ b/terceiro-ano/lisp/hello.lisp @@ -0,0 +1 @@ +(print "Hello, World!") diff --git a/terceiro-ano/lisp/list.lisp b/terceiro-ano/lisp/list.lisp new file mode 100644 index 0000000..6b9fb87 --- /dev/null +++ b/terceiro-ano/lisp/list.lisp @@ -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 ))