Camm, On Wednesday, September 06, 2006 1:50 PM you wrote: > > Bill Page writes: > ... > > > > > > In src/interp/nlib.lisp.pamphlet: > > > > > > ---------- > > > > > > ;; ($ERASE filearg) -> 0 if succeeds else 1 > > > (defun $erase (&rest filearg) > > > (setq filearg (make-full-namestring filearg)) > > > - (if (probe-file filearg) > > > + (if (directory (truename filearg)) > > > #+:CCL (delete-file filearg) > > > #+:AKCL > > > (if (library-file filearg) > > > (delete-directory filearg) > > > (delete-file filearg)) > > > 1)) > > > > > > ---------- > > > > > ... > > However I remain a little uncertain if 'directory' is really > > the proper way to check for the existence of a file or > > directory in common lisp? > > > > 1) I think you want (null (pathname-name (truename filearg))) > > 2) or (and (directory filearg) (not (probe-file filearg))) >
Sorry, I still feel a little "dense" about this. Could you take a minute to translate these two expressions for me? I want (if (... filearg) ) to be true if filearg is either a file *or* a directory. I suspect that 2) requires that it be a directory and not a file since 'probe-file' is now interpreted as specifically as testing for a *file*. So maybe that one is not right? I am also worried about the "wild-card" properties of 'directory' which is not something I really want. But I don't know the semantics of 1) at all, and having consulted the lisp docs as deeply as possible, I am still not sure. What exactly does expression 1) do on GCL? Regards, Bill Page. _______________________________________________ Axiom-developer mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/axiom-developer
