Add more TD code snippets
[TD_LISP.git] / functions.lsp
diff --git a/functions.lsp b/functions.lsp
new file mode 100755 (executable)
index 0000000..79c4c55
--- /dev/null
@@ -0,0 +1,13 @@
+#!/usr/bin/env newlisp
+
+; function addition
+(define (f x y) (+ x y))
+(println (f 1 2))
+
+(define f (lambda (x y) (+ x y)))
+(setq f (lambda (x y) (+ x y)))
+;(set 'f (lambda (x y) (+ x y)))
+(println (f 1 2))
+(println ((lambda (x y) (+ x y)) 1 2))
+
+(exit)