(if ny (return nil)
(setf x (cdr x) y (cdr y)))))))
+#|
(unless (fboundp 'length=n-p) ; already defined in ASDF
(defun length=n-p (x n)
;(= (length x) n)
(cond
((zerop i) (return (null l)))
((not (consp l)) (return nil))))))
+|#
(defun length<-p (x y)
;(= (length x) (length y))
(when more-strings
(princ sep stream)))))
+#| use ASDF:LAST-CHAR and ASDF:FIRST-CHAR
(unless (fboundp 'last-char)
(def*fun last-char (string)
(check-type string string)
(unless (zerop l)
(char string (1- l))))))
-(def*fun but-last-char (string)
- (check-type string string)
- (let ((l (length string)))
- (unless (zerop l)
- (subseq string 0 (1- l)))))
-
(unless (fboundp 'first-char)
(def*fun first-char (string)
(check-type string string)
(unless (zerop (length string))
(char string 0))))
+|#
+
+(def*fun but-last-char (string)
+ (check-type string string)
+ (let ((l (length string)))
+ (unless (zerop l)
+ (subseq string 0 (1- l)))))
(def*fun string-prefix-p (prefix string)
(let* ((x (string prefix))
(defun conc-string (&rest rest)
"make a string by concatenating stuff"
- (apply #'strcat (mapcar #'->string rest)))
+ (apply #'asdf:strcat (mapcar #'->string rest)))
))
(eval-now
(coerce s 'simple-base-string)
s))))
+#| use ASDF:STRCAT
(eval-now
(unless (fboundp 'strcat)
(defun strcat (&rest strings)
;; (let ((basicp (every #'string-basic-p strings)))
;; (apply #'concatenate (if basicp 'base-string 'string) strings))
))
+|#
(defvar +back-path+ (make-pathname :directory '(:relative :back))
"logical parent path")
+#| don't use this. Probably use ASDF:PATHNAME-ROOT
(defun pathname-base-pathname (pathname)
(make-pathname :directory nil :defaults pathname))
+|#
#| use ASDF:PATHNAME-PARENT-DIRECTORY-PATHNAME
(defun pathname-parent (pathname)
(defun directory-name-p (name)
(and (stringp name)
- (eql #\/ (last-char name))))
+ (eql #\/ (asdf:last-char name))))
(defun portable-pathname-string-component-char-p (c)
(declare (type character c))
(make-pathname :directory (unless (equal r '(:relative)) (nreverse r))
:name name :type type)))
-#|
+#| ;; use ASDF:SUBPATHNAME
(defun subpathname (path string)
(merge-pathnames*
(portable-pathname-from-string string :allow-absolute nil)
(and (consp directory) (eq (car directory) :absolute))))
(defun portable-namestring-absolute-p (namestring)
- (eql (first-char namestring) #\/))
+ (eql (asdf:first-char namestring) #\/))
(defun portable-pathname-absolute-p (name)
(etypecase name
(cond
((equal x "")
(error "empty namestring"))
- ((eql (last-char x) #\/)
+ ((eql (asdf:last-char x) #\/)
(pathname x))
(t
- (pathname (strcat x "/")))))
+ (pathname (asdf:strcat x "/")))))
(pathname
(if (or (pathname-name x)
(pathname-type x)
(:export
#:$buffer-size #:*package-misdefinition-warning-hook*
#:*safe-package* #:*standard-readtable*
- #:+all-chars-base-feature+ #:absolute-pathname-p
+ #:+all-chars-base-feature+ ;; #:absolute-pathname-p
#:accessors-equal-p #:acond #:acond2 #:adjust-size #:aif
#:aif2 #:alist->hash-table #:association
#:base-char-p #:binary-heap #:binomial-heap #:boolean
#:if-testing #:if2 #:initialize-instance #:insert-item!
#:insert-node! #:integers-below #:integers-between #:it
#:join-strings #:kwote #:least-item #:length<-p #:length<=-p
- #:length<=n-p #:length<n-p #:length=-p #:length=n-p
+ #:length<=n-p #:length<n-p #:length=-p ;; #:length=n-p
#:length>-p #:length>=-p #:length>=n-p #:length>n-p #:let1
#:list->vector #:list-of-integers
#:literalp #:make-collector #:make-defpackage-form
#:remove-nth #:rlist* #:safe-read #:safe-write #:search-tree
#:set-container-contents-from-list! #:simplify-string
#:single-arg #:single-arg-form-p #:sized-container-mixin
- #:strcat #:string-all-base-char-p #:string-basic-p
+ #:string-all-base-char-p #:string-basic-p ;; #:strcat
#:->string #:style-warn #:test-form #:test-forms
#:test-only #:the* #:ttest #:ttest* #:unfeaturify
#:vector->list #:vector-container-mixin
#:with-magic-special-variables-safely #:with-msv #:with-msv*
#:with-output-stream #:with-input-stream
#:with-user-output-file #:xtime #:_
- #:first-char #:last-char #:but-last-char
+ #:but-last-char ;; #:first-char #:last-char
;; #:proper-list-p
#:form-starting-with-p
#:make-hashset
#:split-list
#:string-prefix-p #:string-suffix-p #:string-enclosed-p
#:string-strip-prefix #:string-strip-suffix
- #:+root-path+ #:+back-path+ #:merge-pathnames*
- #:pathname-directory-pathname #:pathname-base-pathname
+ #:+root-path+ #:+back-path+ ;; #:merge-pathnames*
+ ;; #:pathname-directory-pathname #:pathname-base-pathname
;; #:pathname-parent
#:top-level-name #:directory-name-p
#:portable-pathname-string-component-char-p
#:portable-pathname-output
#:portable-namestring
#:portable-pathname-from-string
- #:subpathname
+ ;; #:subpathname
#:pathname-absolute-p
#:portable-namestring-absolute-p
#:portable-pathname-absolute-p
#:unwilden
#:append1 #:append1f #:funcallf ;; #:appendf #:nconcf
#:with-nesting #:nest #:tsen
- #:while-collecting
+ ;; #:while-collecting
#:parse-macro-lambda-list
#:list-starts-with-p
;; #:parse-body
:documentation "Test string functions"))
(deftest test-strcat ()
- (is (equal (strcat "foo" "bar" "baz") "foobarbaz")))
+ (is (equal (asdf:strcat "foo" "bar" "baz") "foobarbaz")))
(deftest test-join-strings ()
(is (equal (join-strings '("/bin" "/usr/bin" "/usr/local/bin") :separator ":")