libera/#commonlisp - IRC Chatlog
Search
9:32:26
pve
Hi, is the "defsystem" syntax used in "asd" files based on some specification? Just curious..
9:35:10
jdz
pve: Documentation has the grammar (not sure if that's what you're asking): https://asdf.common-lisp.dev/asdf.html#The-defsystem-grammar
9:40:24
pve
jdz: Thanks, I meant if the syntax was defined in conjunction with the development of ASDF in an ad-hoc fashion, or if the syntax (or parts of it) had been specified earlier by someone else.
9:41:23
jdz
Pretty sure previous versions of system definition facilities (hence the A in the name) were considered when the library was being written.
10:09:11
pve
I was reading this thread about ASDF where some people suggested having a specification for a system definition facility (as opposed to a just a single implementation) and it sounded like a pretty cool idea.
10:14:20
phoe
ASDF is the local optimum until there happens to be a force that can move everything to a different local optimum
10:56:56
rotateq
like when i defined naively an initialize-instace :before which should be with :after and then i wondered why the other still tried to fire ^^
10:57:55
rotateq
hm there's also REMOVE-METHOD, or you look what closer-mop has in charge additionally
10:59:02
frodef
you have to FIND-METHOD first. It's quite tedious, which is why it should be in the IDE.
10:59:41
rotateq
ah that makes sense, like when i figured out how to list only certain EQL specializer methods for a generic function with closer-mop
11:00:29
rotateq
so you would want to be with the cursor in your source file and then call slime-undefine-method?
11:01:41
frodef
Also, some sort of generic function inspector where you can see and remove methods would be nice.
11:19:47
beach
Emacs has a very approximate idea of what is in your .lisp buffer. I mean, it can't even indent or highlight correctly. Expecting it to recognize a method or a generic function would be too much.
11:21:56
beach
You could see it as a Second Climacs rant. (first) Climacs is no longer a thing, and Second Climacs is being developed very slowly, so not usable yet.
11:23:14
beach
Well, the first one was already better for Common Lisp editing than Emacs, at least in some respects. Second Climacs uses a Common Lisp reader (Eclector) to parse the buffer contents, so it has a much better idea of the contents.
11:43:38
lisp123win
For my understanding, why are there so many revisions and changes to ASDF (or any other build tool)? The naive part of me just wants now to write a series of LOAD forms and be done with things
11:44:41
lisp123win
(and I was programming in another language, and building was a complete DISASTER, so I do appreciate ASDF alot)
11:45:10
lisp123win
rotateq: Hello from a closed source machine where my every key is tracked into M$ ML models :-)
11:45:55
rotateq
what i also got to like is this Shake Haskell tool to fight against Make madness. but it's not really normally usable yet, a bit complicated and hmm. but in the long run it does things better too
11:46:12
mcoll
what is the canonical way to interact with cairo in common lisp? I see cl-cairo2 but it's almost 10 years old, is it up to date enough? is the cairo API that stable?
11:48:00
rotateq
mcoll: don't confuse this with being "out of date" :) there is real legacy with CL and it could also mean "finished and usable"
11:49:30
lisp123win
I am have started to branch into other languages just for fun, but now we are going off topic so I will shut up :-)
11:49:42
mcoll
yeah, fair enough, maybe my question could be reformulated, what is the best way currently in CL to generate images with text rendering?
11:56:19
foxfromabyss
I have a function of 2 arguments, and would like to pass it as `:test` in `find` with one of them already supplied, as `find` requires a function of 1 argument
11:56:20
foxfromabyss
I tried making a function of 2 arguments return a lambda requiring 1 argument, with 1 argument already applied, but that failed to compile for some reason
12:01:24
foxfromabyss
that was my initial idea, but I have a `cons point_1 point_2` and would like to check if either of them satisfies equality
12:01:33
mcoll
foxfromabyss, I think you're closing the lambda parenthesis, so you're not returning a lambda so B is not defined
12:03:58
foxfromabyss
but how do I call that now? `((test 5) 6)` and `(6 (test 5))` fails with illegal function call
12:10:22
mcoll
well, it looks like cl-cairo2 loads and the demos work, so I guess I'll continue with this until I hit a wall
12:37:26
phoe
I assume you can generate a proper MEMBER type with a macro in order to avoid typing them all in
12:38:09
phoe
(deftype characters-between (first last) `(member ,@(loop for code from first to last collect (code-char code)))) or something
15:58:05
beach
http://metamodular.com/SICL/environment-info.pdf is the latest version of our paper on Trucler to be submitted to ELS'22. Feel free to give us feedback. I am not sure whether we should include CLISP in the section on previous work, and I am not sure where to find the most recent CLISP code. Opinions are welcome.
15:58:37
beach
The deadline is presumably this coming Sunday, but I fully expect another week of extended deadline.
16:02:46
beach
It has no CLtL2 environment functions. I might have a look at the native environment representation, but it is likely to be in C.
16:08:22
phoe
but there's no good way to access them from the outside, I can't find any good interface after a really quick look
16:10:08
phoe
whatever it is, it prints some lambda-like Lisp forms, so it has to keep them memorized somewhere
16:11:39
phoe
that's a macro to return the current environment, similar to what I've done above, I guess
16:19:33
contrapunctus
beach: re: clobber-demo, to get the aforementioned error ( https://paste.rs/MEQ ) all I did was `(ql:quickload :clobber) (in-package :clobber-demo) (do-things-1)` ...any idea why that's happening?
16:23:32
contrapunctus
I thought it was supposed to be a symbol, perhaps, but quoting it didn't change anything
16:24:36
contrapunctus
(i.e. `'*transaction-log*` instead of `*transaction-log*` ) ...and, well, it gave a different error.
16:29:42
beach
contrapunctus: I am sorry that it's not better documented. I wrote it mostly as a concrete suggestion in the debate about prevalence, serialization, etc.
16:47:10
contrapunctus
beach: just made a PR 😀️ see if you like this as the README - https://github.com/robert-strandh/Clobber/blob/fb401800f0bb9f986691279d4349dc4925823cf3/README.md
16:59:20
phoe
I am free to instead write 50 kB of Markdown regarding the state of our Common Lisp world in light of some recent kerfluffles that echoed through it
17:05:15
beach
It seems to me that people spend more energy obsessing about this "community" thing than they spend working to get more stuff done.
17:14:12
Bike
not that i've been paying much attention, but "somebody is hassling the ASDF dev enough that they want to quit" seems like a specific actionable issue
17:15:12
phoe
I gotta finish my article about that since finger-pointing at people is a thing that is both dangerous and missing the point
17:28:10
rotateq
oki, I'm glad to be allowed to learn so much from you all, as exchange of thoughts is very important
17:29:44
phoe
I have no idea if it's explicit permission - IMO it's more like, you simply are a decent citizen of #commonlisp
17:31:24
phoe
no spamming, no trolling, no personal attacks, no asking the same question over and over again, no soliciting money after proclaiming yourself to be the sole worthy leader of the Common Lisp community at large and the only savior from some almighty mafia thing that is both otherwise undefeatable and comically impotent in stopping you altogether
17:31:47
phoe
just hanging out and asking questions is more than fine, that's what #commonlisp is for
17:37:33
rotateq
yes right, like you for example. I'm no programming genius like gilberth or others here, but I try to get better every day.
17:43:29
Bike
"ffloor, fceiling, ftruncate, and fround handle arguments of different types in the following way: If number is a float, and divisor is not a float of longer format, then the first result is a float of the same type as number. Otherwise, the first result is of the type determined by contagion rules;"
17:44:28
Bike
by the contagion rules, if divisor is a rational it's converted to a float of number's type, so the result will be of that type
17:44:47
Bike
and if it's a float of shorter or equal format, by the contagion rules it will be converted ot the larger format, again giving you the type of number
17:45:27
Bike
not specifically, but the way this is phrased the divisor clearly exists, presumably defaulting to 1 if necessary
17:45:31
phoe
Bike: maybe it's a repetition; see e.g. CLHS STRING which does not mention the term "string designator" and instead spells out the "string, symbol, or character" thing fully
17:46:13
Bike
yeah but the page on the string function doesn't also use the phrase "string designator"
17:49:40
Bike
no, but i mean, the way this ftruncate is written, it's phrased as if these rules are different from the general contagion rules
17:51:56
Bike
if it just repeated the contagion rules, that would be one thing. but no, it says "do this, except sometimes do the contagion rules instead"
17:53:01
aeth
it could've just been something that wasn't caught in the editing process as the standard changed over time
17:53:08
Bike
semz: point, but then if we follow the text as written, we do follow the contagion rules if number is a rational (so if the divisor is also a rational, the result would be)
17:55:02
jasom
In theroy if you did ffloor 1.0d 'a then the result would need to be a double-float since the divsor is not a float of a longer format :P
18:02:34
jasom
Also, it might matter for implementations with subtypes of real other than integer and float?
18:03:17
jasom
Also, it might matter for implementations with subtypes of real other than rational and float?
18:04:30
jasom
log-scaled numbers would apply, maybe fixed-point too (though those are arguably rationals)
19:28:48
rotateq
phoe: but if you would like it, i could come up from time to time here with another erc instance and give statements (rather than expressions) like "all those silly parentheses!" and then leave :D
19:31:11
rotateq
i remember this one dude some months ago immediately "is clhs the best that can be done?" or others
20:04:47
simendsjo
In some languages, I can use _ as a variable (or prepend _) to indicate a variable is unused. In CL, this is `(declare (ignore x))` as I understand it. While it does what I want, it's very verbose, especially in short lambdas. Are there a shorthand/hack available?
20:06:07
semz
Within loop forms you can use nil to indicate that the variable is unused, but this is a special case.
20:06:08
phoe
the only helpful thing is that required arguments in DEFMETHOD don't have this behavior
20:08:48
jmercouris
anyone can think of an elegant way of collecting every other element from a list? E.G. (list 0 1 2 3 4) -> (list 1 3)
20:09:02
jmercouris
now, note that this list isn't a number, so I can't do evenp or some other such heuristic
20:09:58
EdLangley[m]
jmercouris: (mapcan (let ((it nil)) (lambda (v) (setf it (not it)) (if it (list v) (list)))
20:09:59
EdLangley[m]
s/jmercouris: (mapcan (let ((it nil)) (lambda (v) (setf it (not it)) (if it (list v) (list)))/jmercouris: (mapcan (let ((it nil)) (lambda (v) (setf it (not it)) (if it (list v) (list)))/
20:10:53
jmercouris
I mean, I understand it, but at glance goin through the codebase, I would do a double take
20:11:16
EdLangley[m]
The predicate would be: (let ((it t)) (lambda (v) (setf it (not it)) (if it (list v) (list))))
20:11:52
phoe
(let ((list '(0 1 2 3 4))) (remove-if #'evenp list :key (alexandria:rcurry #'position list)))
20:12:07
EdLangley[m]
Where true-every-other-time is: (let ((it t)) (lambda (v) (setf it (not it)) (if it (list v) (list))))
20:15:55
phoe
jmercouris: https://franz.com/support/documentation/cl-ansi-standard-draft-w-sidebar.pdf
20:18:33
rotateq
jmercouris: i remember very well the situation i was in when beginning, so yes, not very beginner friendly :)
20:20:22
rotateq
oh i can imagine, for me not so much, but other "not normal" stuff and more math things before
20:21:40
rotateq
and now you're so deeply into the AWESOME project of nyxt jmercouris, or don't i remember that correctly?
20:22:33
rotateq
firefox annoys me more and more, but i have to redo the nyxt tutorial and manual, so finally can get productive at serious browsing too
20:22:50
jmercouris
well, 2.2.4 is quite good, and I would say is a suitable replacement for a standard browser
20:23:43
semz
EdLangley[m]: Funny enough that's really a criticism of everything outside Lisp in disguise
20:26:01
rotateq
"… it's just that in C++ and the like, you don't trust anybody, and in CLOS you basically trust everybody. The practical result is that thieves and bums use C++ and nice people use CLOS."
20:36:29
theothornhill
Can someone help me understand this a little better? What is the shl for, and how does that relate to the line below? That's line 10-11
20:38:37
dre
i got the common lisp client merged into nvim-conjure if there's still nvim users here.
20:44:25
Bike
yeah. "immediate" because it's in a register or something instead of memory. and "tag" is the end 0. non-fixnums have different tags.
20:45:54
Bike
yes. zero is used as a tag since it has the convenient property that you can add and subtract tagged fixnums without untagging or retagging.
20:47:57
theothornhill
Yeah, because then the number will end in zero, so the condition will always be false, no?
20:47:58
Bike
i guess probably some sb32 times itself is a bignum, and it's a check to return that in that case?
20:48:31
theothornhill
Yeah, maybe, but i set safety 0 and speed 3, so probably that will fail if we overflow?
20:50:43
Bike
so, if the imul overflows, num must have been -2147483648, so the cmov arranges to return the bignum 4611686018427387904
20:51:28
Bike
if you put in some non-(signed-byte 32), since you have safety 0, it will just return that bignum anyway
20:54:17
rotateq
theothornhill: be careful declaring (optimize (safety 0)) when full moon is, the loopus is out for hunt
20:54:49
theothornhill
So it's a conditional check for overflow that checks whether the shift left destroys the tag?
20:57:32
rotateq
in 'Common Lisp Recipes' edi clearly says the three steps of optimizing "1. don't do it. 2. don't do it. 3. don't do it (yet)"
20:58:10
rotateq
so much money and time always wasted every day in the world with directly think about over-optimizations sacrifycing other stuff