Here is how I organize my own projects. I hope maybe some of you have some comments on this.

I use packages fairly heavily, with the project spread over 9 packages currently. This is in order to encapsulate functionality, and to avoid having to load unnecessary functionality in different builds. The packages are contained within separate directories, with a main file containing the package definition.

ASDF is use to manage the system build and dependencies. I see a lot of complaining about ASDF, but it seems to works for me.

I put a test directory under each package directory, containing an additional test package. This test package separates testing dependencies and symbols from the main package, and makes it easy to load and run the tests. The ASDF definition loads the main package and the testing framework (fiveam), while the test package definition imports internal symbols from the main package as needed. Each CL code file in the main package will usually have a corresponding .test.lisp file with the associated tests.

Code files are usually centered around specific data structures (eg. CLOS classes), generic function interfaces or particular functionality. There usually some shuffling around of statements to avoid warnings at load/compile time.

I organize things similarly. One thing I like about your setup is the separation of tests and regular code. I usually do not like libraries conflating these two aspects in a single file, especially because tests are dependent on a specific testing library which I may not want to deal with.

One thing that has turned me off ASDF (besides being a pain on Windows) is that it doesn't seem to take version numbers into account. I suppose if developers named their packages as :my-library1 and the successor as :my-library2 (and so on) then api issues would be mitigated.

Instead of using asdf I'm trying to organize thing into modules. I like the way Python does it; you just load the module when you need it, and it works. The developer using the module doesn't need to be concerned with anything other than how to use it.

So I do things in a similar way as you do, with the exception of using a modular design over asdf (I know their both modular, but the way their executed is different).

I usually use ASDF to package my code, but do not use that symbolic link .asd managing stuff. I have setup a hierarchical folder structure where I just drop the ASDF packages folder at the right place. Some function grovels over all folders, collection *.asd and adding each folder that has a *.asd on the asdf:*central-registry*. If there is a conflicting system the function tells me so.

Neonsquare wrote:Some function grovels over all folders, collection *.asd and adding each folder that has a *.asd on the asdf:*central-registry*.

It is possible to write custom system-definition search function (function that takes system name and returns the file), and then push it into asdf:*system-definition-search-functions*. I used such function when trying ASDF on windows.