From: leonelag
Subject: [Newbie] - How can I access libraries defined in other files ?
Date: 
Message-ID: <1191420983.872380.250580@k79g2000hse.googlegroups.com>
Hi,

Common-lisp newbie here.

I'm running CLisp on Ubuntu. I've installed the Ubuntu package with
the LML markup library, which copied some files to /usr/share/common-
lisp.

Now, how do I access the functions and packages defined in those
files ? When I try to use the package with:

(in-package :lml)

I get this:

SYSTEM::%FIND-PACKAGE: There is no package with name #1="LML"
   [Condition of type SYSTEM::SIMPLE-PACKAGE-ERROR]

I'm coming from a Java background; what would be the equivalent in
Lisp to the Java class path ?

Thanks
Leonel
From: Alex Mizrahi
Subject: Re: [Newbie] - How can I access libraries defined in other files ?
Date: 
Message-ID: <4703aa56$0$90266$14726298@news.sunsite.dk>
 l> I'm coming from a Java background; what would be the equivalent in
 l> Lisp to the Java class path ?

Lisp model differs a little from the Java one. in Lisp package is merely a 
namespace, collection of symbols -- it is not associated with files in any 
way. quite like C++'s namespace.

what you are looking for is called "system" -- that's kinda some set of 
related files, e.g. library. this is not a standard part of the language, 
but nowadays ASDF is de-facto standard for working with systems.

luckily, on Debian/Ubuntu ASDF is automatically integrated with OS package 
systems (via common-lisp-controller, iirc). so, all installed systems 
(including LML) are already in classpath. you just need to load them:

(asdf:oos 'asdf:load-op :lml)

in SBCL it's integrated with Common Lisp REQUIRE function -- so in SBCL you 
can call (require 'lml).

when you'll be making some bigger application, you can also use ASDF to load 
it, and this way it will handle dependencies on other systems in a nice way 
(there's section for dependencies in "asd" -- system definition file).

in case you'd once be working with "raw" ASDF, analog of it's CLASSPATH is 
variable called asdf:*central-registry*. on Debian it's like that:

[10]> asdf:*central-registry*
((MERGE-PATHNAMES ".clc/systems/" (USER-HOMEDIR-PATHNAME))
 *DEFAULT-PATHNAME-DEFAULTS* #P"/usr/share/common-lisp/systems/")

so no wonder it will automatically pick system definitions from 
/usr/share/common-lisp/systems
also note that it can by default pick system definitions from a special 
files in your home dir and from current directory ( 
*DEFAULT-PATHNAME-DEFAULTS* is like current directory)