freenode/#lisp - IRC Chatlog
Search
6:54:09
elderK
Hey guys, I recently felt like tinkering with Lisp again and did some reading of the CLHS.
6:54:37
elderK
The specs say that it's up to the implementation whether a slot accessor is setfable?
7:04:41
elderK
dmh: I get the feeling this CLHS page was rushed or is kinda... wrong. If you follow the syntax spec for defstruct, you'd think they you can only specify a *single* option for slots.
7:06:21
elderK
dmh: I'm not even sure how you'd go about implementing a setf for defstruct. I mean, structures are different from objects, right? They're not just some "cut down" version of CLOS classes?
7:08:12
dmh
installing something from planet and finishing a project in a day and then not touching either for a month :-)
7:10:29
elderK
Which, of course, complicates things a fair bit if you want to make your RT things reasonably efficient.
7:12:46
elderK
(I figured I'm make a minimal binding for SDL2 and make a simple 2D 'game' where you just move yer dude around the screen. Nothing complex.)
7:13:44
elderK
CFFI seems pretty nice - I played with it a couple years back, the groveller and stuff.
7:13:55
dmh
i was causing something to greatly fuck up and couldnt figure itout. lost those sources to a like 10 year old SSD pooping out
7:14:56
elderK
I've lost track of how much time I spent creating my own implementation of records and objects and stuff in Scheme.
7:15:43
elderK
Years and years ago, I was scheming in a big way - reading tons of whitepapers and stuff. But, whenever I tried to do something *real*, like say, write a program to analyze ELF binaries, I just... found it very painful.
7:18:11
elderK
I used to play with Racket back when it was called PLT Scheme. I never really liked it much - sure, it had Planet and stuff but... I don't know, it didn't feel like Scheme.
7:18:28
elderK
So I migrated to Chicken pretty fast. The fantastic community of #chicken kept me using it :)
7:20:38
elderK
It's sad, really. Like, at my last job, I would tell interested friends about CL, Scheme, Standard ML, etc.
7:22:07
elderK
It's kind of depressing, tbh. I used to believe you needed to be *great* at programming and stuff to get a job.
7:22:45
elderK
The majority of programmers at the company - who possessed degrees - didn't even remember when they should use what data structures, everything was just a linked list.
7:28:00
elderK
I.e. You complete some project, written nicely, maintainable, extensible. You're done well before the deadline.
7:43:00
elderK
I WOULD read some existing libraries for this - but, it's... like... You don't want to jump into the deep end straight away, you know?
8:51:28
phoe
beach: This guide is why I asked, actually. It is nothing that I can see used contemporarily.
8:53:36
beach
That one has several problems in it, including some highly personal taste being recommended, rather than agreed-upon conventions.
9:22:20
edgar-rft
elderK: a copy of the common-lisp.net repository is here: <https://github.com/fare/asdf>
12:43:16
malice
Is this the proper approach and I've done some stupid mistake, or is the problem more complex or my approach wrong?
12:47:03
Bike
(defmacro debug-break (&rest args) (if *debug* `(break ,@args) nil)), then there will be breaks only if *debug* was true at compile time
12:47:22
malice
I didn't want to put it in code, just to use in REPL to try out the stuff. I'm not used to leaving hacks in the code.
12:48:03
malice
May I know why it won't work though? I thought that the call to BREAK would call my function, as the global definition is shadowed by the local one?
12:50:25
malice
Bike: so to make things clear, were this some other function, non-locked, e.g. #'FOO, the code would work?
12:52:54
Bike
if you do want something like 'special functions', you can just do like (defun foo (&rest args) (apply *foo* args)) and then bind *foo*
13:19:16
|3b|
instead of messing with the BREAK, you could add a handler to pick the continue restart automatically
13:27:44
elderK
Guys, when you're writing a new program, like, creating your own ASDF system and all, do you link your project's directory into wherever ASDF's source registry is?
13:28:45
elderK
After skimming the ASDF3 manual, I've just placed a bunch of prereq systems in ~/.local/share/common-lisp/sources. SBCL's happy and can find them all.
13:38:37
jmarciano
When I use my own ASDF system, how do I prevent this appearing WARNING: DEFUN/DEFMACRO: redefining function IN-USER-CONFIGURATION-DIRECTORY in /home/data1/protected/.cache/common-lisp/clisp-2.49+-unix-x64/home/data1/protected/lib/lisp/quicklisp/dists/quicklisp/software/uiop-3.1.7/backward-driver.fas, was defined in /home/data1/protected/lib/lisp/quicklisp/cache/asdf-fasls/0ktqad/asdf.fas -- do I need to clear Quicklisp cache?
13:40:54
jmarciano
I know what you mean thanks. Is this related to my private project or quicklisp cache?
13:46:10
jmarciano
I eliminated many of them by realizing I was using image which already had alexandria and some of :depends, but I still have warning left
13:48:04
jmarciano
if I understand well, if I quicklisp load "asdf", also uiop is loaded, so I do not need to mention "uiop" in system.asd
13:57:34
elderK
malice: I'd agree with you there. The only reason I ever use Clisp is to build SBCL.
13:57:58
jmarciano
and I am not sure, do I need to list all :depends or just one that asks others in chain.
13:59:57
jmarciano
malice: maybe is not, it just works and I use development version, even stable one works.
14:01:17
|3b|
elderK: it might be older than the groveller, and i don't thing the groveller would have helped with that anyway (and would mean people needed a working C compiler to load lispbuilder-sdl)
14:02:39
elderK
|3b|: I see what you mean wrt to requiring a C compiler. But other than that, I think the groveller would've helped.
14:03:00
jmarciano
I would like to remove WARNING: Adding method #<STANDARD-METHOD :AFTER (#<STANDARD-CLASS TEST-OP> (EQL #<SYSTEM "spatial-trees">))> to an already called generic function #<STANDARD-GENERIC-FUNCTION PERFORM> -- but I don't know where to start
14:03:40
elderK
|3b|: And aye, I'm not sure how old the Groveller is. Maybe you're right, maybe it didn't exist when LBSDL was being written.
14:06:02
jmarciano
if for example cl-ansi-text which I have in :depends-on also has :depends-on "alexandria" do I need to remove "alexandria" from my ASD file?
14:06:34
|3b|
you should depend on whatever you use, so you don't break if the other lib decides to change their deps
14:06:36
elderK
Out of curiosity, what's the usual... system... most people use for unit testing in CL?
14:08:34
p_l
elderK: I think RT is one of the oldest packages around, recall reading some paper on it that really dated it
14:08:53
malice
jmarciano: np. I would clear caches and see if it helps, but other than that, I have no idea
14:10:49
p_l
actually a lot of code is long-lived but usually hampered by dependencies that change under it
14:11:29
elderK
That raises another question: How does CL play with native functions that may block? Provided say, we're calling those native functions via CFFI from some thread, via say bordeaux threads?
14:12:11
elderK
p_l: I have no problem with old code if it works, works well. If it hasn't been changed, maybe it simply didn't need to? Maybe it was already perfect :)
14:13:44
jmarciano
I just see, if I remove for example "alexandria" which is anyway loaded by other :depends-on files I get less warnings
14:15:25
elderK
jmarciano: AFAIK, you want to specify *direct dependencies*. Not indirect dependencies.
14:16:44
jmarciano
but |3b| said I should define to what I depend on, in case other libraries change it.
14:17:10
jmarciano
and I see, if I do that cffi-manner it has less warnings, as it is not double loaded.
14:17:52
p_l
if you don't, but a library you depend on uses it, you don't include it in your system deps
14:18:10
malice
jmarciano: No, not really. You only specify your direct deps. If other library changes the deps, it's not your problem.
14:18:15
elderK
You can't control what other things depend on - and you shouldn't rely on it, either.
14:20:46
jmarciano
I was expecting then the ASDF to handle those matters automatically, for example why is ASDF then loading multiple times alexandria...
14:20:49
malice
elderK: I've heard nice things about prove. I've been using fiveam myself, but prove has better support for Roswell
14:21:32
elderK
roswell's nice for automating installation of implementations, as well as setting up stuff like quicklisp, right?
14:22:38
elderK
I don't use QuickLisp - I was wondering if that's a kind of outmoded way to do things these days.
14:25:11
elderK
Anywho, still curious as to how threading works via bourdeaux threads, with respect to native functions that block.
14:26:35
elderK
And you when you interface with stuff like epoll, you have to let their runtimes know that it's a blocking call and such.
14:27:29
malice
I see. I haven't been using these threads directly, so I don't know, but I believe they aren't green
14:29:01
elderK
Another question! (Sorry, I'm full of them. I *am* looking at existing projects to try and learn but... you guys are here... so...)
14:29:27
elderK
What's the best way to pass say, a buffer that's a vector in CL, to native code? I've seen things like static-vectors about.
14:29:45
elderK
Or if you'd just foreign-alloc a buffer and use that instead of using CL vectors at all.
14:30:42
elderK
Maybe these questions aren't so important. It's just, I come from C. So, naturally, I've very interested in issues of interfacing CL ro it.
14:32:55
akr[m]
Hello, I wonder if someone could help me with a build error from buildapp/asdf I'm getting. The error is `Component :DE.SETF.AMQP.AMQP-1-1-0-9-1 not found` and it's caused by `--eval "(asdf:operate 'asdf:load-op :de.setf.amqp.amqp-1-1-0-9-1)"` argument to buildapp. Strangely enough, I stared getting the error when I've checkout out another git branch, however when I've switched back to the original branch where it was working,
14:34:20
pjb
Probably, this exact version is not available from the quicklisp distribution in quicklisp anymore.
14:37:29
pjb
Then inspect ~/quicklisp/local-projects/ and any other place configured in asdf for your local systems. Install manually de.setf.amqp there (~/quicklisp/local-projects/).