[slime-cvs] CVS slime
CVS User heller
heller at common-lisp.net
Fri Jun 4 07:30:26 UTC 2010
Update of /project/slime/cvsroot/slime
In directory cl-net:/tmp/cvs-serv9268
Modified Files:
ChangeLog swank.lisp
Log Message:
* swank.lisp: Move definition of LCONS before first use.
Patch from Stelian Ionescu <sionescu at cddr.org>
--- /project/slime/cvsroot/slime/ChangeLog 2010/06/04 07:30:13 1.2107
+++ /project/slime/cvsroot/slime/ChangeLog 2010/06/04 07:30:26 1.2108
@@ -1,3 +1,7 @@
+2010-06-04 Stelian Ionescu <sionescu at cddr.org>
+
+ * swank.lisp: Move definition of LCONS before first use.
+
2010-06-04 Helmut Eller <heller at common-lisp.net>
* swank-allegro.lisp (socket-fd): Add support for allegro.
--- /project/slime/cvsroot/slime/swank.lisp 2010/06/04 07:30:05 1.718
+++ /project/slime/cvsroot/slime/swank.lisp 2010/06/04 07:30:26 1.719
@@ -3290,6 +3290,52 @@
(list (to-string name) loc)))
+;;;;; Lazy lists
+
+(defstruct (lcons (:constructor %lcons (car %cdr))
+ (:predicate lcons?))
+ car
+ (%cdr nil :type (or null lcons function))
+ (forced? nil))
+
+(defmacro lcons (car cdr)
+ `(%lcons ,car (lambda () ,cdr)))
+
+(defmacro lcons* (car cdr &rest more)
+ (cond ((null more) `(lcons ,car ,cdr))
+ (t `(lcons ,car (lcons* ,cdr , at more)))))
+
+(defun lcons-cdr (lcons)
+ (with-struct* (lcons- @ lcons)
+ (cond ((@ forced?)
+ (@ %cdr))
+ (t
+ (let ((value (funcall (@ %cdr))))
+ (setf (@ forced?) t
+ (@ %cdr) value))))))
+
+(defun llist-range (llist start end)
+ (llist-take (llist-skip llist start) (- end start)))
+
+(defun llist-skip (lcons index)
+ (do ((i 0 (1+ i))
+ (l lcons (lcons-cdr l)))
+ ((or (= i index) (null l))
+ l)))
+
+(defun llist-take (lcons count)
+ (let ((result '()))
+ (do ((i 0 (1+ i))
+ (l lcons (lcons-cdr l)))
+ ((or (= i count)
+ (null l)))
+ (push (lcons-car l) result))
+ (nreverse result)))
+
+(defun iline (label value)
+ `(:line ,label ,value))
+
+
;;;; Inspecting
(defvar *inspector-verbose* nil)
@@ -3509,51 +3555,6 @@
(reset-inspector)
(inspect-object (frame-var-value frame var))))
-;;;;; Lazy lists
-
-(defstruct (lcons (:constructor %lcons (car %cdr))
- (:predicate lcons?))
- car
- (%cdr nil :type (or null lcons function))
- (forced? nil))
-
-(defmacro lcons (car cdr)
- `(%lcons ,car (lambda () ,cdr)))
-
-(defmacro lcons* (car cdr &rest more)
- (cond ((null more) `(lcons ,car ,cdr))
- (t `(lcons ,car (lcons* ,cdr , at more)))))
-
-(defun lcons-cdr (lcons)
- (with-struct* (lcons- @ lcons)
- (cond ((@ forced?)
- (@ %cdr))
- (t
- (let ((value (funcall (@ %cdr))))
- (setf (@ forced?) t
- (@ %cdr) value))))))
-
-(defun llist-range (llist start end)
- (llist-take (llist-skip llist start) (- end start)))
-
-(defun llist-skip (lcons index)
- (do ((i 0 (1+ i))
- (l lcons (lcons-cdr l)))
- ((or (= i index) (null l))
- l)))
-
-(defun llist-take (lcons count)
- (let ((result '()))
- (do ((i 0 (1+ i))
- (l lcons (lcons-cdr l)))
- ((or (= i count)
- (null l)))
- (push (lcons-car l) result))
- (nreverse result)))
-
-(defun iline (label value)
- `(:line ,label ,value))
-
;;;;; Lists
(defmethod emacs-inspect ((o cons))
@@ -3601,7 +3602,6 @@
;;;;; Hashtables
-
(defun hash-table-to-alist (ht)
(let ((result '()))
(maphash #'(lambda (key value)
More information about the slime-cvs
mailing list