freenode/lisp - IRC Chatlog
Search
13:50:56
ralt
_death: are you still maintaining dbus? I've been playing with it again this week, and the main issue I have with it is the error reporting. For example, an invalid list of parameters returns an EOF error
13:53:35
ralt
Because the introspection is runtime but the classes and their slots are defined at compile time :/
15:28:19
_death
ralt: sure, I can review and accept patches.. not using it nowadays so there are no changes coming from me
15:38:43
_death
ralt: I guess one way to make a lispy interface would be to write something that generates stub code from an interface and dump it to a file.. then your code could depend on that stub (harnessing asdf) and the names it exports
17:49:54
rlp10
How do you append a subdirectory to the end of a pathname? I'm finding the number of different libraries a bit confusing, since what I want to do is pretty common I guess.
17:52:10
rlp10
phoe: Thank you, that's really helpful. I guess it's the other way round from what I was expecting, but that makes no odds. I don't know why I was struggling to find it so much. Anyway, I appreciate your quick response - thanks.
17:53:42
aeth
phoe: shouldn't it be uiop:merge-pathnames* to fix portability issues between implementations?
17:55:19
rlp10
aeth: So is that what I should be using? Quite a bit of my scripting deals with folders, files, their contents etc.
17:57:25
aeth
rlp10: uiop/filesystem and uiop/pathname and uiop/configuration (and maybe a few other parts of uiop) may be able to help with some of your problems, but I'm not very familiar with the nuances because I rarely work with complicated file-based operations. Iirc, ASDF mostly uses UIOP for this.
17:58:03
aeth
rlp10: e.g. (uiop:xdg-config-home) should get you the correct parent directory of where you should put your configurations.
17:58:30
aeth
Well, on Linux (XDG) and on Windows (whatever Windows uses). It treats macOS like a Unix, rather than using macOS's custom conventions, so it might not be fully idiomatic there depending on what you're doing.
17:58:42
rlp10
OK, I have to confess that I'm new, so I don't fully understand what uiop and asdf are. I'd probably better start by reading their websites.
18:00:37
aeth
rlp10: Packages in CL are namespaces for symbols. Quicklisp is the "package" manager, but since the name "package" was taken, it's really the "system" manager. Systems are ASDF systems, and they basically are the standard library format in CL. ASDF fills a similar role to e.g. make. ASDF uses UIOP as its utility library, which means UIOP can be useful if you're dealing with files.
18:02:45
aeth
UIOP or CL-FAD should give you what you need, but since most people already have UIOP installed (because it's used by ASDF), the latter is probably more popular.
18:04:18
aeth
UIOP does a *ton* of extra stuff, but it's mostly used for its file/path/etc. functionality.
18:13:32
aeth
It's usually polite to stay within subdirectories of uiop:xdg-config-home or uiop:xdg-cache-home or uiop:xdg-data-home if reading/writing. If only reading, then asdf:system-source-directory will get you the directory of a system (i.e. library). I guess you start from cl:user-homedir-pathname if you want to read/write e.g. ~/Documents
18:37:42
aeth
ralt: yes, and then you can write something like this: (apply #'path-from-dir (funcall lookup-function) (append (if org-name (list org-name)) (list app-name)))
18:38:57
aeth
ralt: that should get you "professional" looking usage of ~/.local/share/ (or whatever the #'xdg-data-home happens to be configured as) where it's ~/.local/share/your-organization/your-app/ or ~/.local/share/your-app/
18:42:15
aeth
(In that case, #'path-from-dir is in turn just a trivial wrapper over uiop:merge-pathnames*)
19:05:37
aeth
ralt: doing (uiop:xdg-data-home #P"foo" #P"bar") I get ~/.local/share/bar rather than ~/.local/share/foo/bar
19:08:26
aeth
ralt: You also need to reverse the order, since the optional part (the parent directory) comes first.
19:09:19
aeth
What I mean is, you want to input "bar" "foo" or "bar" NIL and get #P"foo/" #P"bar/" or #P"bar/"
19:13:13
ralt
#p"foo" is a pathname that represents a file, so when you try to use it and don't get it as part of a folder... that's expected
19:14:05
aeth
ralt: This is slightly improved: (apply lookup-function (append (if org-name (list (uiop:make-pathname* :directory `(:relative ,org-name))) nil) (list (uiop:make-pathname* :directory `(:relative ,app-name)))))
19:18:50
aeth
i.e. (funcall lookup-function (make-pathname* :directory `(:relative ,@(if org-name (list org-name) nil) ,app-name)))
19:39:04
aeth
This should be simple enough... maybe I should move it to my utils: https://gitlab.com/zombie-raptor/zombie-raptor/-/blob/e50f8366e2ec24258a436fa8f4b2ec0f7627fc6e/data/data-path.lisp
1:05:18
charles`
Can someone help me understand ~/.cache/common-lisp/ ? Does that allow me to compile a system once, then next time I load it, asdf will just load the already compiled version?
1:20:32
charles`
So should I be able to use quicklisp to install a system, then restart lisp, then load using asdf without quicklisp or recompilation?
1:22:07
aeth
For the most part, Quicklisp is used because it will download something if it hasn't already been download it.
1:22:42
Xach
charles`: if you don't load quicklisp at all, it's possible that the directory it's found in is not known to asdf, and it won't necessarily load
1:26:54
charles`
Do I need to configure asdf to look at ~/.cache to find them? is ~/.cache an asdf thing or quicklisp thing. I can't find ~/.cache in asdf manual
1:29:45
aeth
It should be something along the lines of (uiop:merge-pathnames* #P"common-lisp/" (uiop:xdg-config-home))
1:31:51
charles`
If my compiled files are in cache, why does asdf still need quicklisp to find them? It can find the main project, but can't find the systems that were pulled in by quicklisp (but are still in cache)
1:32:39
aeth
charles`: My guess is Quicklisp adds some directories, like ~/quicklisp/local-projects/, that aren't default directories in ASDF.
1:33:57
Xach
Finding systems to load, and loading their cached compiled fasls, are very distinct operations.
1:35:31
Xach
charles`: yes, but there are exceptions there too, like monofasls. that gets into some territory i don't know much about.