[cxml-devel] Handling doctype declarations for system-ids?
Marco Antoniotti
marcoxa at cs.nyu.edu
Mon Mar 20 16:41:07 UTC 2006
On Mar 20, 2006, at 5:29 PM, David Lichteblau wrote:
> Quoting Marco Antoniotti (marcoxa at cs.nyu.edu):
>> Just to be nitpicking. Merging *d-p-d* (which I assume to be
>> *DEFAULT-PATHNAME-DEFAULTS*) isn't guaranteed to work. *d-p-d* can be
>> a relative pathname. Wouldn't that cause the same problem?
>
> Well, ISTR that CMUCL starts with an empty *default-pathname-defaults*,
> so I recognize that CMUCL users might indeed still have this problem
> even with the patch.
>
> And since the spec is terribly vague on this issue (like most issues
> relating to pathnames), the implementation choice made by CMUCL
> maintainers is technically correct.
>
> However,
> - the spec does say that *default-pathname-defaults* is "typically in
> the working directory that was current when Common Lisp was
> started up".
> - it's the only approximation of the concept of a "working directory"
> I am aware of in portable Common Lisp and many Lisps implement it
> like that.
> - if the implementation chooses not to set it to the working
> directory, users can easily fix that by setting or binding it
> themselves. (Or, of course, by passing an absolute pathname to
> cxml:parse-file in the first place...)
>
> So using it seems like a reasonable compromise to me, and improves the
> situation on some Lisps while not making it worse on the others.
I do think that it still has problems. Think of
(let ((*default-pathname-defaults* (make-fiendshly-relative-pathname)))
;; run CXML code.
)
It is true that *d-p-d* is usually what you think, but since it is a
variable that can be manipulated, it is not safe to assume any value
for it.
I would either introduce a CXML variable, or use USER-HOMEDIR-PATHNAME,
which is guaranteed to be "constant".
In alternative, I would use some package that masks the implementation
vagaries and gives you the notion of "working directory". CLOCC port
is one of them (or, shameless plug, cl-environment)
Cheers
Marco
--
Marco Antoniotti http://bioinformatics.nyu.edu/~marcoxa
NYU Courant Bioinformatics Group tel. +1 - 212 - 998 3488
715 Broadway 10th FL fax. +1 - 212 - 998 3484
New York, NY, 10003, U.S.A.
More information about the cxml-devel
mailing list