Hacker News new | ask | show | jobs
by 147 1207 days ago
There's a weird spike in new accounts with what appear to be AI generated comments in this thread.

One problem I run into when learning Common Lisp is ASDF. For some reason I can't figure out how to use it properly. For example, when I open a system definition in a new REPL, what's the expected workflow? I'm using emacs and slime by the way. Maybe my environment is set up wrong. I also have to prefix the `defsystem`s with `asdf:`. When I look at examples in open source projects they just straight up use `uiop` functions and `defsystem` in their `.asd` files without the package.

7 comments

This should help: https://lispcookbook.github.io/cl-cookbook/getting-started.h...

The workflow is:

- open the .asd file,

- compile it so that your Lisp image knows about it: C-c C-k in Slime, or (asdf:load-asd "project.asd")

- you are ready to "quickload" it.

The link shows how you can tell ASDF to find your projects at startup, so than you can "quickload" it directly.

Thanks, I honestly felt a bit gaslighted with the way no one was mentioning anything about these accounts.
>There's a weird spike in new accounts with what appear to be AI generated comments in this thread.

There's also a chatbot company on the front page posted by a new account. I kinda suspect they're related.

As a former "good old fashioned AI" researcher who used Lisp (LispWorks) between '89 and '95 this seems oddly appropriate!
What do you mean by "open [...] in a new REPL"?

You use ASDF:LOAD-SYSTEM to have ASDF load all the content of the system, making it available to you.

I edited the comment to add some additional details.

Am I not supposed to load or compile the contents of an `.asd` file?

No you do not have to. ASDF knows where to find your ASD files:

https://asdf.common-lisp.dev/asdf.html#Configuring-ASDF-to-f...

Personally I use the (:tree (:home "dev/lisp")) form.

Just don't put a node_modules/ in there!
Thanks a lot for this actually. I just gave it a shot and it seems to have been the piece I've been missing.
You can load the contents of a .asd file (this can be useful when developing on versions other than what you want in your ASDF search path). It is unnecessary outside of that use case though.
You need to have ASDF itself loaded into your Lisp.

Yes one can also load system definitions, they are Lisp code. But usually it is expected that they are found automatically, when calling a system operation (load, compile, ...), when registered correctly.

Just use quicklisp, it handles ASDF in a nice manner. Then jou just grow into using ASDF.