You could slightly generalize double, and accept any atoms. This would
allow you to simplify it.
You could also use emacs and let it do the indentation for you!
(defun double (object)
(typecase object
(cons (cons (double (car object)) (double (cdr object))))
(number (* 2 object))
(t object)))
(mapcar (function double)
'( () abc 123 (1 2.0 #C(3 4) a b c (5/2 6 d e f) 7 8 9) ))
(NIL ABC 246 (2 4.0 #C(6 8) A B C (5 12 D E F) 14 16 18))
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 433 |
Nodes: | 16 (2 / 14) |
Uptime: | 95:48:28 |
Calls: | 9,100 |
Calls today: | 3 |
Files: | 13,418 |
Messages: | 6,028,547 |