14 Aug 19:53
some pathname wildcard code
From: Russell McManus <russell_mcmanus <at> yahoo.com>
Subject: some pathname wildcard code
Newsgroups: gmane.editors.j.devel
Date: 2008-08-14 17:55:56 GMT
Subject: some pathname wildcard code
Newsgroups: gmane.editors.j.devel
Date: 2008-08-14 17:55:56 GMT
Something like the following might be useful in implementing support
for wild pathnames in DIRECTORY in abcl.
One issue that I aware of but did not address is that I used
STRING-EQUAL in a couple of places that might be incorrect on Windows
and/or OSX.
-russ
(defpackage :abcl-hacks
(:use :common-lisp :java))
(in-package :abcl-hacks)
(defun make-name-and-type-matcher (pathname)
(let ((name1 (pathname-name pathname))
(type1 (pathname-type pathname)))
(flet ((to-string (jstring)
(jcall (jmethod (jclass "java.lang.String") "toString") jstring))
(split-path-and-type (s)
(let ((dot-pos (position #\. s)))
(if dot-pos
(values (subseq s 0 dot-pos) (subseq s (1+ dot-pos)))
(values s "")))))
(cond ((and (eql :wild name1)
(eql :wild type1))
(lambda (jstring)
(declare (ignore jstring))
t))
(Continue reading)
I did not intend to fully replace the code in pathnames.lisp, but rather to illustrate one approach
to a fuller fix. I am not sure that I understand the overall structure of abcl to replace system
level code.
-russ
----- Original Message ----
> From: Erik Huelsmann <ehuels <at> gmail.com>
> To: Russell McManus <russell_mcmanus <at> yahoo.com>
> Cc: armedbear-j-devel <at> lists.sourceforge.net
> Sent: Friday, August 15, 2008 12:46:25 AM
> Subject: Re: [j-devel] some pathname wildcard code
>
> On Thu, Aug 14, 2008 at 7:55 PM, Russell McManus
> wrote:
> >
> > Something like the following might be useful in implementing support
> > for wild pathnames in DIRECTORY in abcl.
> >
> > One issue that I aware of but did not address is that I used
> > STRING-EQUAL in a couple of places that might be incorrect on Windows
> > and/or OSX.
>
> Hi!
>
> I'm about to step onto a flight, but let me take a minute to say
> thanks for the contribution! When having a cursory look at
RSS Feed