Lisp HUG Maillist Archive

How to make own modules ?

How to make own modules ?

Hi all,
can anyone give me a hint how to have my own modules
with LWW ?
I want to be able to (require 'foo) for some modules
in a way similar to CMUCL where (require 'foo) tries to find
the module in a predefined directory.
I know about mk:defsystem and ASDF but i assume that it
is still possible with native LWW.

Thanks in advance
AHz

Re: How to make own modules ?

Unable to parse email body. Email id is 1387

Re: How to make own modules ?

owner-lisp-hug@xanalys.com wrote on 10/10/2003 09:48:42 AM:

> 
>    can anyone give me a hint how to have my own modules
>    with LWW ?
>    I want to be able to (require 'foo) for some modules
>    in a way similar to CMUCL where (require 'foo) tries to find
>    the module in a predefined directory.
>    I know about mk:defsystem and ASDF but i assume that it
>    is still possible with native LWW.
> 
> LispWorks does not support this. Why not do:
> 
> (require 'foo "/predefined/directory/foo")
> 

For the same reason that LispWorks doesn't do it that way: to abstract 
away the location of modules. Given that it already exists and is used, 
why not go ahead and support it?


Re: How to make own modules ?

MichaelL@frogware.com writes:

> For the same reason that LispWorks doesn't do it that way: to abstract 
> away the location of modules. Given that it already exists and is used, 
> why not go ahead and support it?

But REQUIRE is evil, isn't it?

Hmm. Maybe I should try to make my simple little SMART-REQUIRE 
publicly available.
-- 
  (espen)


Re: How to make own modules ?

Unable to parse email body. Email id is 1392

Re: How to make own modules ?

* MichaelL  wrote:
> For the same reason that LispWorks doesn't do it that way: to abstract 
> away the location of modules. Given that it already exists and is used, 
> why not go ahead and support it?

Note that logical pathnames can abstract the position of modules
away.  Even without the REQUIRE-MODULE I described just now, you can
do:

   (require :com.cley.weld "CLEY-LIB:COM;CLEY;WELD;WELD-LOADER")

(or whatever convention you want) which just leaves you to define the
logical host appropriately.  In fact to first order REQUIRE-MODULE
just destructures the module name in the obvious backwards-domain-name
way and then uses it to construct a sequence of appropriate (generally
logical) pathnames.

--tim






Re: How to make own modules ?

* Andreas Hinze wrote:
> Hi all,
> can anyone give me a hint how to have my own modules
> with LWW ?
> I want to be able to (require 'foo) for some modules
> in a way similar to CMUCL where (require 'foo) tries to find
> the module in a predefined directory.
> I know about mk:defsystem and ASDF but i assume that it
> is still possible with native LWW.

We have a structured version of REQUIRE, whereby you say something
like:

(require-module :com.cley.weld)

And it will do some fairly smart (and configurable via a fairly hardy
search spec) searching, looking for things like
CLEY-LIB:COM;CLEY;WELD;WELD-LOADER and various other things.  When it
finds something it loads it and expects it to do a PROVIDE somewhere
along the line (typically the loader file loads a sysdcl and then
loads the system - there is actually some (hacky) support for
`forgetting' system definitions).

Apart from the forgetting-system stuff it it probably portable CL.  I
could make it available (but not now) if anyone is interested.
Actually, it's possible that it *is* available if you look in my lisp
hax stuff, I forget if that was part of the LW-specific things.

--tim


Re: How to make own modules ?

MK:DEFSYSTEM as a standard entry point

	ADD-REGISTRY-LOCATION <pathname>

which you can stick in your .lispwork init file.

MK:LOAD-SYSTEM and MK:COMPILE-SYSTEM will look in the directories 
listed in MK:*CENTRAL-REGISTRY* for system definition files.

That is to say,

	(mk:compile-system "foo")

Will look for a file named "foo.system" in all the directories listed 
in MK:*CENTRAL-REGISTRY*.  Hopefully, the file will contain a system 
definition form for system "foo".

MK:*CENTRAL-REGISTRY* will always contain the current directory.

Cheers

Marco

On Friday, Oct 10, 2003, at 06:47 America/New_York, Andreas Hinze wrote:

> Hi all,
> can anyone give me a hint how to have my own modules
> with LWW ?
> I want to be able to (require 'foo) for some modules
> in a way similar to CMUCL where (require 'foo) tries to find
> the module in a predefined directory.
> I know about mk:defsystem and ASDF but i assume that it
> is still possible with native LWW.
>
> Thanks in advance
> AHz
>
>
--
Marco Antoniotti
NYU Courant Bioinformatics Group		tel. +1 - 212 - 998 3488
715 Broadway 10th FL				fax. +1 - 212 - 998 3484
New York, NY, 10003, U.S.A.


Re: How to make own modules ?

On Fri, 10 Oct 2003 12:47:33 +0200, Andreas Hinze <AHZ@smi.de> wrote:

> can anyone give me a hint how to have my own modules
> with LWW ?
> I want to be able to (require 'foo) for some modules
> in a way similar to CMUCL where (require 'foo) tries to find
> the module in a predefined directory.
> I know about mk:defsystem and ASDF but i assume that it
> is still possible with native LWW.

I'm not sure if this is what you're looking for but here are two old
threads which might be helpful:

  <http://article.gmane.org/gmane.lisp.lispworks.general/495/>
  <http://article.gmane.org/gmane.lisp.lispworks.general/503/>

Have a nice weekend,
Edi.


Updated at: 2020-12-10 08:59 UTC