[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Issue: PATHNAME-WILD (Version 2)
- To: Mly-lisp@MC.LCS.MIT.EDU
- Subject: Issue: PATHNAME-WILD (Version 2)
- From: Kent M Pitman <KMP@STONY-BROOK.SCRC.Symbolics.COM>
- Date: Thu, 6 Oct 88 22:35 EDT
- Cc: KMP@STONY-BROOK.SCRC.Symbolics.COM, CL-Cleanup@SAIL.Stanford.EDU
- In-reply-to: <19881007020748.5.MLY@JACKIE.AI.MIT.EDU>
Date: Thu, 6 Oct 88 22:07 EDT
From: Richard Mlynarik <MLY@AI.AI.MIT.EDU>
The CL pathname model does not provide a way to represent such wildcards,
which means, for example, that (MAKE-PATHNAME :NAME "F*O") cannot be
recognized by portable code as containing a wildcard.
This is not even `portable' code for creating a wildcarded pathname.
How do you distinguish between pathname named "f*o" and a wildcarded
pathname which starts with an #\f and ends with an #\o?? (BTW, the
Symbolics pathname system ducks the entire issue.)
The pathname specification is so crippled that adding dinky frobs like
PATHNAME-WILD-P isn't going to make any difference to `portability' --
about all it will add is another page to the CL manual.
The purpose of this isn't to say what's wild, it's to give portable code
a way to guard against wildcards.
Sample portable program that it is not possible to write correctly now
but would be after this proposal:
(DEFUN SHOW-FILE (FILE) ;Allows wildcards
(DOLIST (FILE (IF (PATHNAME-WILD-P FILE)
(DIRECTORY FILE)
(LIST FILE)))
(WITH-OPEN-FILE (STREAM FILE)
(DO ((LINE (READ-LINE STREAM NIL NIL) (READ-LINE STREAM NIL NIL)))
((NOT LINE))
(FORMAT T "~&~A~%" LINE)))))