repositories
/
TD_LISP.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Properly indent some code path
[TD_LISP.git]
/
lists.lsp
diff --git
a/lists.lsp
b/lists.lsp
index 432d9c7b80f8510e6e9aacdd2c7c4faea0889321..273dee0dfd8f0fcd0b4812f8509b74a2c2e12d9c 100755
(executable)
--- a/
lists.lsp
+++ b/
lists.lsp
@@
-12,9
+12,9
@@
;(println (last '()))
(define (list-length a-list)
;(println (last '()))
(define (list-length a-list)
-
(if a-list
-
(+ 1 (list-length (rest a-list)))
-
0))
+ (if a-list
+ (+ 1 (list-length (rest a-list)))
+ 0))
(println (list-length L))
(println (list-length L))
@@
-26,20
+26,20
@@
type list ::= empty-list | first * list
(println (+ x 1))
(set 'x 1 'y 2)
(println (+ x 1))
(set 'x 1 'y 2)
-(let ((x 3) (y 4))
- (println x)
-
(println (list x y)))
+(let ((x 3) (y 4))
+ (println x)
+ (println (list x y)))
(println "x="x" y="y)
(setq x 3 y 4)
(let ((x 1) (y 2))
(println "x="x" y="y)
(setq x 3 y 4)
(let ((x 1) (y 2))
-
(println "x="x" y="y))
+ (println "x="x" y="y))
(println "x="x" y="y)
(setq x 3 y 4)
(let ((y 2))
(println "x="x" y="y)
(setq x 3 y 4)
(let ((y 2))
- (setq x 5 y 6)
-
(println "x="x" y="y))
+ (setq x 5 y 6)
+ (println "x="x" y="y))
(println "x="x" y="y)
(exit)
(println "x="x" y="y)
(exit)