I like to partition up my projects into several libraries, so that
certain functionality can be easily reused.
When I build on top of those libraries, I can use 'load' (I do not use
require and provide since they are declared obsolete). However, what
is the best place to add the load ?
- In the application itself, at the beginning of the file ? This seems
to work for just executing an application. When compiling, however, it
seems I can get different problems :
- compiling the file in itself fails because of unresolved
dependencies.
- loading the libraries before the compilation solves this problem,
but this is a duplication.
- not including a load in the application requires the user to check
the file itself for dependencies.
The thing is that I am used to Perl's use and Python's import
statements, but these languages are not compiled. When I use Common
Lisp only as an interpreter, load works fine. It is just that when I
want to compile files, things go awry.
I know about asdf, but I am working cross-platform, and asdf's use of
symbolic links gives problems on Windows (CLISP under Windows/Linux,
and SBCL under Linux).
So, what gives ? When one does not use asdf or another build system,
what is the best recourse to take ?
Regards,
Jurgen
In article <························@i13g2000prf.googlegroups.com>,
jurgen_defurne <··············@pandora.be> wrote:
> I like to partition up my projects into several libraries, so that
> certain functionality can be easily reused.
>
> When I build on top of those libraries, I can use 'load' (I do not use
> require and provide since they are declared obsolete). However, what
> is the best place to add the load ?
REQUIRE and PROVIDE are useful as simple user-level functions
on top of a DEFSYSTEM.
>
> - In the application itself, at the beginning of the file ? This seems
> to work for just executing an application. When compiling, however, it
> seems I can get different problems :
> - compiling the file in itself fails because of unresolved
> dependencies.
> - loading the libraries before the compilation solves this problem,
> but this is a duplication.
> - not including a load in the application requires the user to check
> the file itself for dependencies.
>
> The thing is that I am used to Perl's use and Python's import
> statements, but these languages are not compiled. When I use Common
> Lisp only as an interpreter, load works fine. It is just that when I
> want to compile files, things go awry.
>
> I know about asdf, but I am working cross-platform, and asdf's use of
> symbolic links gives problems on Windows (CLISP under Windows/Linux,
> and SBCL under Linux).
>
> So, what gives ? When one does not use asdf or another build system,
> what is the best recourse to take ?
Before you write your own, you can use an existing DEFSYSTEM.
I use a derivative of Mark Kantrowitz' DEFSYSTEM.
See for example:
http://www.cliki.net/mk-defsystem
>
> Regards,
>
> Jurgen
--
http://lispm.dyndns.org
jurgen_defurne wrote:
> I know about asdf, but I am working cross-platform, and asdf's use of
> symbolic links gives problems on Windows (CLISP under Windows/Linux,
> and SBCL under Linux).
You may want to have a look at *system-definition-search-functions* in
asdf.lisp. This is a list of functions to be called in order when
looking for an asd file (the default sysdef-central-registry-search is
what implements the unix-friendly "look in the *central-registry* chase
symlinks"), and can be extended/replaced with something that searches
for definition files in whatever places you're likely to keep them.
-dan