How do you set the load path?

  • Follow


In sbcl, I want to add my personal lib directory to the path LOAD
looks in to find files.  Is there a way to do that in a [.]sbclrc
file or some other centralized place?  I tried this:
(setf *default-pathname-defaults*
	(merge-pathnames (pathname "/my/path/name/")
                          *default-pathname-defaults*))

but that replaced the current directory instead of adding to it.

-- 
Dan
www.prairienet.org/~dsb/
0
Reply randomgeek (299) 5/15/2007 7:27:10 PM

Dan Bensen <randomgeek@cyberspace.net> writes:

> In sbcl, I want to add my personal lib directory to the path LOAD
> looks in to find files.  Is there a way to do that in a [.]sbclrc
> file or some other centralized place?  I tried this:
> (setf *default-pathname-defaults*
> 	(merge-pathnames (pathname "/my/path/name/")
>                           *default-pathname-defaults*))
> 
> but that replaced the current directory instead of adding to it.

*DEFAULT-PATHNAME-DEFAULTS* isn't a list, it's a single pathname. LOAD
doesn't search multiple directories.

For my personal projects, I always make ASDF files to load them, and
symlink the .asd files into ~/.sbcl/systems/. Then I can use REQUIRE.

Zach
0
Reply xach (862) 5/15/2007 7:26:43 PM


Dan Bensen <randomgeek@cyberspace.net> writes:

> Zach Beane wrote:
> > *DEFAULT-PATHNAME-DEFAULTS* isn't a list, it's a single pathname.
> 
> That's why I tried merge-pathnames instead of PUSH.  I thought it
> might return something like #P"/my/path/name/;/path/to/current/dir/".

MERGE-PATHNAMES takes a pathname with missing parts and copies the
parts from another pathname to fill it out as much as possible. The
resulting single pathname is a merger of two pathnames into one, not
two pathnames into two or more.

Zach
0
Reply xach (862) 5/15/2007 8:12:23 PM

Zach Beane wrote:
> *DEFAULT-PATHNAME-DEFAULTS* isn't a list, it's a single pathname.

That's why I tried merge-pathnames instead of PUSH.  I thought it
might return something like #P"/my/path/name/;/path/to/current/dir/".

> For my personal projects, I always make ASDF files to load them, and
> symlink the .asd files into ~/.sbcl/systems/. Then I can use REQUIRE.

Thanks.  It looks like asdf:*central-registry* may work, but I wanted
to make sure there wasn't another way.

-- 
Dan
www.prairienet.org/~dsb/
0
Reply randomgeek (299) 5/15/2007 8:12:51 PM

3 Replies
46 Views

(page loaded in 0.09 seconds)

Similiar Articles:













7/26/2012 5:00:51 PM


Reply: