From eed80989c03e8852e03042a61112c2d3b7662f0f Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 25 Oct 2022 21:34:31 +0300 Subject: [IPL/H01] Added initial implementation --- .../Homework 01/example.lisp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Year 2/Implementation of Programming Languages/Homework 01/example.lisp (limited to 'Year 2/Implementation of Programming Languages/Homework 01/example.lisp') diff --git a/Year 2/Implementation of Programming Languages/Homework 01/example.lisp b/Year 2/Implementation of Programming Languages/Homework 01/example.lisp new file mode 100644 index 0000000..cd7a577 --- /dev/null +++ b/Year 2/Implementation of Programming Languages/Homework 01/example.lisp @@ -0,0 +1,21 @@ +(defvar *NAME* "John") +(defvar *AGE* 23) +(defvar *ABOUT* " T NIL cond decf block") + +;;; This is a stupid funciton +(defun adult? () + (>= *AGE* 18)) + +(defun will-I-graduate? () + NIL) + +(defun distance (p1 p2) + (sqrt (* p1 p1) (* p2 p2))) + +(defun bar (a b) + (if (and (> b a) (<= 10 b)) + (format t "Valid") + (format t "Invalid"))) + +(defun foo (&key ((:apple a)) ((:box b) 0) ((:charlie c) 0 c-supplied-p)) + (list a b c c-supplied-p)) -- cgit v1.3.1-26-gb76a