axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] $erase (Re: [Axiom-commit] SF.net SVN: axiom: [209


From: root
Subject: Re: [Axiom-developer] $erase (Re: [Axiom-commit] SF.net SVN: axiom: [209] trunk3)
Date: Sat, 28 Oct 2006 13:06:36 -0400

> Grrr... you broke my code... and you introduced some bugs :-)
> 
> Here you affect a pathname to filearg but you will use delete-directory
> with this pathname as argument. delete-directory want a string since its
> code is:
> 
> (defun delete-directory (dirname)
>    (system (concat "rm  -r " dirname)))
> 
> concat does not take pathname as argument.
> 
> More complicated to explain: 'erase' uses make-full-namestring which
> returns approximately (concat current-directory the-argument) and calls
> truename which will return a pathname even if this pathname does not
> exist (I consider this as a bug in GCL). So, since 'directory' in GCL
> returns a list of files or directories (more precisely pathnames) that
> matches a "pattern" (see the end of this mail), 'delete-directory' will
> be called if you have a file or a directory with a name "pattern
> matched" even if this file or directory does not exist.
> 
> Now even if you fix the code, with 'namestring' for example, $erase will
> work only on directories (~> _(not (probe-file filearg)_). If we
> consider that 'probe-file' worked in the past on directories and files
> the $erase function need to be able to delete file too.
> 
> $erase is used "everywhere" in the interpreter and I can not check if
> this new specialisation of $erase will break the code so I can not say
> that this is a bug, I can only say: "hey guys you broke my code and
> possibly other part of the interpreter please allow $erase to work on
> file too, in this way I'll continue to use it or I will create the old
> $erase function with a different name." :-)
> 
> Here is the code that I use actually but it's no meant to be included in
> Axiom, do what you want with it (directoryp can be rewritten in
> "full-lisp" with the new si::stat GCL function now):
> 
> 
> ;; ($ERASE filearg) -> 0 if succeeds else 1
> (defun $erase (&rest filearg)
>   (setq filearg (make-full-namestring filearg))
>   (if (or (probe-file filearg) (eql (|directoryp| filearg) 1))
> ; In CCL delete-file can delete a directory?
> #+:CCL (delete-file filearg)
> #+:AKCL
>       (if (library-file filearg) ; always true (can be removed)
>           (delete-directory filearg)
>           (delete-file filearg))
>       1))

You're using code which is not Gold.

The silver code, from any source, has NOT been tested.
I resisted making these changes public for a long time,
keeping them local until I ran tests and released them.

It was argued that the silver patches should be public
and I followed the consensus, putting up axiom--silver--1




The correct way to handle this change is to find all of
the places where any filename assumptions are made,
understand what the correct behavior is, and change
every location that is wrong. This has to happen before
the changes go into Gold which is planned for the end
of november. Any help with that effort would be apprciated.

t




reply via email to

[Prev in Thread] Current Thread [Next in Thread]