Question about library dependencies

Discussion of Common Lisp

Question about library dependencies

Postby joeish80829 » Thu May 08, 2014 1:38 pm

In my library I have 2 .asd files,the main .asd file and another .asd file that has 1 module with 2 files that depend on the 20 or so files in my main .asd file. I have the smaller.asd file because it has functions that are garbage collected that have the same name as non GC functions in my main .asd file and are callable in the main .asd file with a prefix..(gc:). But now the main .asd file has to depend on the smaller .asd file and the 50 or so functions(with the same name)in it...how do I go about setting this up. do I just duplicate all the functions housed in my smaller .asd file, and add a % to the start of their name and add that file to my main .asd file (which would work) or is there another better way to acomplish this.
Last edited by joeish80829 on Fri May 09, 2014 6:08 pm, edited 1 time in total.
joeish80829
 
Posts: 153
Joined: Tue Sep 03, 2013 5:32 am

Re: Question about library dependencies

Postby pjstirling » Fri May 09, 2014 11:22 am

ASDF systems are for compiling and loading self-contained code modules. There is no sanity in having two libraries that depend on each other, either they should be one library, or they should be instead three (or more), with the shared functionality factored out.
pjstirling
 
Posts: 80
Joined: Sun Nov 28, 2010 4:21 pm

Re: Question about library dependencies

Postby joeish80829 » Sat May 10, 2014 8:10 am

Can you help me figure out how to define my library, I have 1 .asd file now with all my main code and another asd file(gc.asd) that depends on it's 20 or so files completly except it has 1 lisp file with all the garbage collected versions of the functions that would need garbage collecting in the main.asd and a package.lisp file exporting those gc functions so they can be called by a prefix "gc:" . The gc: is used so I can call function "test" from my main library and use manual MM or with-macros to manage memory, or I can call "gc::test" and the function will be automatically memory managed. The thing is, in my main .asd file is a file with a function that needs 2 functions from the gc.asd file to use in an &optional param list , because it would be faster. I expect more like that too. Can you help me figure out how to now depend on the gc.asd file in my main .asd file.
joeish80829
 
Posts: 153
Joined: Tue Sep 03, 2013 5:32 am


Return to Common Lisp

Who is online

Users browsing this forum: No registered users and 4 guests