freenode/#lisp - IRC Chatlog
Search
0:55:59
aeth
There are two ways to do packages. One is to do one package per file, at the top of the file, and it looks a lot like Python or Java in the end. This is the minority style. The majority style is to have one package.lisp for the entire system, or possibly one package.lisp per directory if it's a very large project.
0:57:01
aeth
There are three ways to do systems. One is to have one large system for everything except possibly tests and examples if they exist. This is the majority style, especially since most projects are small. Another breaks systems into directories. Another associates systems with files and packages, using this: http://davazp.net/2014/11/26/modern-library-with-asdf-and-package-inferred-system.html
0:57:09
pagnol
I'm about to begin working on a client-server app and I was going to set it up roughly like this if this makes sense: https://gist.github.com/anonymous/986b798f2292b1537e69ef4742e87aad
0:57:40
pagnol
then foo would correspond to the server part, say, and bar to the client part, and they share some utils which would be in 'mylibrary'
0:57:53
|3b|
pagnol: examples and tests frequently have dependencies the main library doesn't, and in addition to wasting space they might also conflict with something that is just trying to use the library
0:58:35
earl-ducaine
|3b|: it would have been more correct for me to say that CL *has* the concept of a module, but the standard does not define what it is.
0:59:02
aeth
pagnol: If you're doing client and server and utils, you probably want (at least) three systems. Someone who's deploying a server probably isn't interested in what foo/client (or foo.client or com.example.client or however you want to name it) provides.
0:59:04
pagnol
so then you would have three separate calls to asdf:defsystem for tests, examples and the actual library/app?
0:59:09
|3b|
you might also have things that link your library to another but that are optional, so that would also be reasonable to put in a separate system for use by people who want to use both, while people who only use your library don't need to load the other
1:00:37
pagnol
and inside my project directory have a subdirectory for each system defined with defsystem?
1:01:47
aeth
pagnol: If you are breaking things up into subdirectories, unless those subdirectories are just foo/examples/ and foo/tests/ then it makes sense to use separate directories, like foo/client/, foo/server/, and foo/utils/
1:02:27
aeth
For anything really small, it doesn't matter, but if it's large, directories are useful to organize things.
1:03:06
aeth
If you want to go with a fairly standard style, you should probably have one system definition per directory and one package.lisp in each directory for the package definition.
1:07:07
earl-ducaine
pagnol: if you're using quicklisp, you can inspect the ~/quicklisp/dists/quicklisp/software directory which will have all the sources quicklisp has downloaded. That will provide you with a wealth of examples of how people have structured their asdf projects.
1:10:36
aeth
Or you can set things up once and basically just copy your old project foo.asd file to use for new bar.asd file when you want to make bar instead of foo
1:12:24
aeth
If you set things up on your own, you probably want to create a link in ~/quicklisp/local-projects/ (or wherever your local-projects directory is) to wherever your project is so Quicklisp can find it as if it was in Quicklisp, e.g. like this: cd ~/quicklisp/local-projects/; ln -s ~/git/foo
1:12:40
aeth
If you use Quickproject, it automatically registers the system so ASDF and Quicklisp can find it iirc.
5:18:36
Bike
that's from what, (macroexpand-1 (with-gensyms ...))? or (macroexpand-1 '(with-gensyms ...))?
5:49:08
Bike
or just run your defmacro again. the point is whatever macro you have bound to with-gensyms ain't that one
6:07:52
krwq
wxie - when you use symbol in your image which doesn't exist it will be interned - after you use alexandria and add the symbol which didn't exist before it will see conflict because you already have it
7:07:09
shrdlu68
What's the way to wait till a thread exits in bordeaux-threads? The docs advise against #'join-thread
8:56:13
shrdlu68
This function counts from 0 past 7 and errors. However, changing "*standard-output*" to "t" in line 8 changes that. How is this happening? https://paste.pound-python.org/show/kNpHapRGwKjykU7YFXSX/
8:58:04
shrdlu68
i.e if I change *standard-output* to t it runs perfectly and counts only from 0 to 7 as it should.
9:03:00
whoman
or .. https://stackoverflow.com/questions/27178642/sbcl-multiple-threads-write-to-standard-output ?
9:09:15
beach
It is not specified whether the final value of a loop counter is the last value you specified or one greater.
9:13:30
shrdlu68
But (loop for i from 0 to 7 collecting i) always results in '(0 1 2 3 4 5 6 7) in SBCL under normal circumstances.
9:15:13
Shinmera
If you want to avoid this you need to create a new binding for the index around each thread creation.
12:21:20
Xach
I'll glom all the separate bits into a single response object, then specialize that object, then have a gf that finds an error condition for that object based on all its parts (response code, headers, body)