Hi, All:
I am trying SBCL 1.02 for WIN32 X86. I do not know how to change
directory under the SBCL system. When I load a lisp file using the
true/full path name, many files which have relative path to that file
cannot be loaded, so I would like to go to the directory first and
load the file there.
How to do this?
best regards,
keyboard
+ "keyboard" <···········@gmail.com>:
| When I load a lisp file using the true/full path name, many files
| which have relative path to that file cannot be loaded
The usual way to deal with this is to construct the full pathname of
the files you wish to load by using
(merge-pathnames relative-path *load-truename*)
as the pathname to load.
--
* Harald Hanche-Olsen <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
when there is no ground whatsoever for supposing it is true.
-- Bertrand Russell
On 29 Mrz., 15:08, Harald Hanche-Olsen <······@math.ntnu.no> wrote:
> + "keyboard" <···········@gmail.com>:
>
> | When I load a lisp file using the true/full path name, many files
> | which have relative path to that file cannot be loaded
>
> The usual way to deal with this is to construct the full pathname of
> the files you wish to load by using
>
> (merge-pathnames relative-path *load-truename*)
>
> as the pathname to load.
>
> --
> * Harald Hanche-Olsen <URL:http://www.math.ntnu.no/~hanche/>
> - It is undesirable to believe a proposition
> when there is no ground whatsoever for supposing it is true.
> -- Bertrand Russell
Thank you. But is there something like clisp (ext:cd) in SBCL?
+ "keyboard" <···········@gmail.com>:
| But is there something like clisp (ext:cd) in SBCL?
There is sb-posix:chdir. But see Pascal Bourguignon's other remark in
the thread.
--
* Harald Hanche-Olsen <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
when there is no ground whatsoever for supposing it is true.
-- Bertrand Russell
On 30 Mrz., 02:18, Harald Hanche-Olsen <······@math.ntnu.no> wrote:
> + "keyboard" <···········@gmail.com>:
>
> | But is there something like clisp (ext:cd) in SBCL?
>
> There is sb-posix:chdir. But see Pascal Bourguignon's other remark in
> the thread.
>
> --
> * Harald Hanche-Olsen <URL:http://www.math.ntnu.no/~hanche/>
> - It is undesirable to believe a proposition
> when there is no ground whatsoever for supposing it is true.
> -- Bertrand Russell
Thank you all.
I tried to build movitz under CLISP, LispWorks(Personal) and SBCL for
windows, none of them succeeded. Do I really need a linux box to work
on?
best regards,
keyboard
"keyboard" <···········@gmail.com> writes:
> I tried to build movitz under CLISP, LispWorks(Personal) and SBCL for
> windows, none of them succeeded. Do I really need a linux box to work
> on?
If you're not masochist, yes. ;-)
You might try cygwin (http://www.cygwin.com),
or coLinux (http://www.colinux.org),
or even a true unix system on Qemu (http://www.qemu.org).
--
__Pascal Bourguignon__
http://www.informatimago.com
http://pjb.ogamita.org
Harald Hanche-Olsen <······@math.ntnu.no> writes:
> + "keyboard" <···········@gmail.com>:
>
> | When I load a lisp file using the true/full path name, many files
> | which have relative path to that file cannot be loaded
>
> The usual way to deal with this is to construct the full pathname of
> the files you wish to load by using
>
> (merge-pathnames relative-path *load-truename*)
>
> as the pathname to load.
And CL usually maintains a different "current working directory" than
the underlying posix system (which may not even exist, for a given CL
implementation).
That is: *DEFAULT-PATHNAME-DEFAULTS*
So, the CL way of doing chdir(path);
is (setf *DEFAULT-PATHNAME-DEFAULTS* path)
A MERGE-PATHNAMES with this default path is done automatically by most
of the CL functions dealing with files.
Of course, if your implementation works on posix and provides a way to
use chdir(2), you might want to keep both synchronized.
(defun cd (path)
(setf *default-pathname-defaults* path)
#+(and clisp linux) (linux:|chdir| (namestring (truename path)))
#|and other implementation dependent insanities...|#)
--
__Pascal Bourguignon__
http://www.informatimago.com
http://pjb.ogamita.org