Permalink
Browse files

swank-lispworks.lisp (replace-strings-with-symbols): Didn't work on

non-proper lists. Reported by Madhu.
  • Loading branch information...
1 parent efbf39b commit 9f2784b32e7a8132eb4f0228d2a3d16e638c35b9 sboukarev committed Sep 28, 2009
Showing with 24 additions and 11 deletions.
  1. +5 −0 ChangeLog
  2. +19 −11 swank-lispworks.lisp
View
@@ -1,3 +1,8 @@
+2009-09-28 Stas Boukarev <stassats@gmail.com>
+
+ * swank-lispworks.lisp (replace-strings-with-symbols): Didn't work on
+ non-proper lists. Reported by Madhu.
+
2009-09-27 Tobias C. Rittweiler <tcr@freebits.de>
* swank-sbcl.lisp (call-with-debugger-hook): Correctly deal with
View
@@ -184,18 +184,26 @@
;;;; Documentation
+(defun map-list (function list)
+ "Map over proper and not proper lists."
+ (loop for (car . cdr) on list
+ collect (funcall function car) into result
+ when (null cdr) return result
+ when (atom cdr) return (nconc result (funcall function cdr))))
+
(defun replace-strings-with-symbols (tree)
- (mapcar (lambda (x)
- (typecase x
- (list
- (replace-strings-with-symbols x))
- (symbol
- x)
- (string
- (intern x))
- (t
- (intern (write-to-string x)))))
- tree))
+ (map-list
+ (lambda (x)
+ (typecase x
+ (list
+ (replace-strings-with-symbols x))
+ (symbol
+ x)
+ (string
+ (intern x))
+ (t
+ (intern (write-to-string x)))))
+ tree))
(defimplementation arglist (symbol-or-function)
(let ((arglist (lw:function-lambda-list symbol-or-function)))

0 comments on commit 9f2784b

Please sign in to comment.