cl-rw

Layered streams for Common Lisp
git clone https://logand.com/git/cl-rw.git/
Log | Files | Refs

commit 1fe2d26e9e9bdc0b0cf529ab927036d7092936aa
parent ef09ef12335cb0501c9de17f8a4e8090421c2dfd
Author: Tomas Hlavaty <tom@logand.com>
Date:   Mon, 19 Aug 2013 21:42:08 +0200

directoryp exported in cl package in ccl?!

Diffstat:
Mfilesystem.lisp | 11+++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/filesystem.lisp b/filesystem.lisp @@ -27,12 +27,11 @@ (in-package :rw.filesystem) -#+nil ;; TODO already defined on ccl?! but not on sbcl? -(defun directoryp (pathname) +(defun %directoryp (pathname) (equal (directory-namestring pathname) (namestring pathname))) (defun directory-reader (pathname &optional recurse) - (when (directoryp pathname) + (when (%directoryp pathname) (flet ((expand (x) (directory (merge-pathnames "*" #+nil "*.*" x)))) (let ((stack (list (expand pathname)))) (lambda () @@ -41,7 +40,7 @@ (unless (car stack) (pop stack)) (prog1 x - (when (and x recurse (directoryp x)) + (when (and x recurse (%directoryp x)) (let ((y (expand x))) (when y (push y stack)))))))))))) @@ -56,13 +55,13 @@ (defun directory-reader (reader) (lambda () (do ((x (rw:next reader) (rw:next reader))) - ((or (not x) (directoryp x)) x)))) + ((or (not x) (%directoryp x)) x)))) #+nil (defun file-reader (reader) (lambda () (do ((x (rw:next reader) (rw:next reader))) - ((or (not x) (not (directoryp x))) x)))) + ((or (not x) (not (%directoryp x))) x)))) ;;(till (rw:peek-reader (directory-reader (dir-reader "/tmp/" t)))) ;;(till (rw:peek-reader (file-reader (dir-reader "/tmp/" t))))