freenode/#lisp - IRC Chatlog
Search
6:50:07
solideogloria[m]
Why does `cl-json` parse the string "!BFYazLCNOAsYDPxIDn:matrix.org" as the symbol !+BF+-YAZ-+LCNO+-AS-+YD+-PX-I-DN:MATRIX.ORG
6:51:50
no-defun-allowed
cl-json only interns keys, from memory. But if you're using it to parse Matrix events, then the number of keys isn't finite, so you probably want to use another library, like jsown.
6:52:13
no-defun-allowed
But some parsers treat a key a:b as the symbol printed as a:b; I think there was also another XML parser that did that.
6:55:43
saturn2
you can override that by binding json:*json-identifier-name-to-lisp* and json:*identifier-name-to-key* to #'identity
7:01:13
loke[m]
It uses strings as keys, which is better (no risk of intern attacks with untrusted data).
7:07:44
jackdaniel
beach: this image is more complete https://common-lisp.net/project/ecl/static/quarterly/img/vol4/all-hierarchy.png
8:55:14
beach
And if you are not restricted to SBCL, in SICL, I store the entire source text of all the code that has been loaded into the image.
8:56:07
oni-on-ion
no-defun-allowed, i wonder what an 'empty' session would have as live objects? aside from classes, packages, symbols etc.
8:56:07
beach
oni-on-ion: I use the source text for reporting errors and warnings, and for backtraces.
8:57:20
beach
oni-on-ion: Methods and generic functions are objects, and there may be data structures involved for organizing those. Most certainly, you have hash tables in your package objects and such.
8:58:13
oni-on-ion
beach, hmm yes i see. have you played around with Squeak at all? having the source in the image allows for some very useful things. like ChangeSet
8:59:12
beach
I have not used Squeak, but my experience from staring at compiler output from SBCL and trying to match it to source code made me think about other ways of doing it.
8:59:41
oni-on-ion
beach, ahh, never had thought of CLOS. i mistakenly think it is bare knuckles, i had been accustomed to the seperation of FoundationKit and AppKit from other lands
9:00:37
beach
Common Lisp being a dynamic language, lots of stuff must be kept track of to allow for incremental updates to the image.
9:02:22
no-defun-allowed
100 megabits? After compression, a SBCL image is about 100 megabits on disk.
9:03:12
no-defun-allowed
(save-lisp-and-die "foo" :executable t :compression 9) gives me a 96 megabit image.
9:04:19
no-defun-allowed
oni-on-ion: After making sure not to load Quicklisp, (room) tells me I'm using about 25MB of dynamic space, and 12.8MB of immobile space. The rest is negligible.
9:09:39
Nilby
When you compare the size of a CL image to most other program binaries, make sure to add the size of most shared libraries, the compiler tool chain, and the debugger.
9:10:38
no-defun-allowed
No need - appimages and Electron programs blow most CL images out of the water in terms of size.
9:35:28
sauvin
I poked around the nets for a while looking at all kinds of different things regarding lisp, then remembered I wanted quicklisp, so, I fired up sbcl, loaded the quicklisp.lisp file and it just took right off. Slicker than CPAN.
9:37:38
sauvin
I think so. A beginner doesn't need to have to try to wrestle with the language implimentation while he's still trying to figure out how to say "sub stuff { 3.14159 * 2**$_[0]}" or "sub chunk { [ split ] }"
9:40:25
sauvin
I've been perling (strictly on an armchair basis, mind) for about twenty years. Lisp gonna be a new way to think.
9:41:31
saturn2
(defun stuff (x) (* 3.14159 (expt 2 x)) the other one doesn't quite have a direct equivalent
9:42:04
no-defun-allowed
"a new way to think" is the wrong way to approach it, in my opinion. Writing in Lisp is frequently "the way I wanted to think about it", except for the times in which it isn't, but those times are much less frequent.
9:42:06
sauvin
Direct, maybe not, but it's what got me wanting libraries to begin with. I didn't want to have to come up with a BASIC-like equivalent.
9:44:53
VincentVega
so far i just do (... &key (w nil) (width nil)) and check for mutual exclusivity but it's a runtime check
9:48:08
saturn2
you could write your own object making function with a compiler macro for the compile time check
9:50:21
Nilby
Probably emacs w/SLY/SIME, vim w/VLIME or something, vs code with some lisp extension, etc. but I don't know since I use my own thing.
9:50:35
no-defun-allowed
For geometric objects, w, h, x and y can be assumed to be width, height, X and Y positions, but it's usually nicer to use full names when someone else is supposed to look at a lambda-list and guess what they can call your functions with.
9:52:00
no-defun-allowed
That was a recurring theme in a funny Usenet thread I read, in which the verbosity of many Common Lisp libraries is supposed to be a problem (as it apparently is bad for "scripting").
9:53:22
no-defun-allowed
If you write (make-instance 'some-class, then SLIME will pop up with a lambda list like (&key this-initarg that-initarg ...) ;; and because unbalanced parens tick me off )
9:58:04
no-defun-allowed
Here, I have to press C-M-i (or ESC TAB or M-TAB, whatever floats your boat) to complete, unless I'm in the REPL, as TAB indents.
9:58:48
Nilby
Alfr_: I just tried it with no configuration on emacs 25.2 and slime 2.26 from melpa. But I'm probably not the person to ask, since I don't use it. SLIME doesn't come close to working on my real configuration.
10:04:04
Alfr_
Nilby, after removing slime-fuzzy-complete-symbol from slime-completion-at-point-functions it works here as well. Thank you. :)
10:09:58
Nilby
Alfr_: Nice! I've saved myself many hours of pointless work by always trying stuff in a clean setup first.
10:13:14
Alfr_
For that one has to know how it's supposed to work in the first place and until you mentioned it, I didn't.
10:15:36
Nilby
I usually just think what I want it to do, and figure somebody must have already done it.
10:19:51
Nilby
When I used to work on emacs the philosophy was, most of your code that isn't docstring should be written by <tab> completion. Snippets really help with that too.
14:35:36
beach
Xach: Do you still check Quicklisp systems with SICL LOOP? I am asking because Alexandria contains two illegal LOOP forms.
14:43:44
phoe
unless you have a separate alexandria dist, which would be the first time I've seen one!
14:44:00
phoe
anyway - I'd clone alexandria into your local-projects and checkout whatever commit you need
15:01:19
troydm
doesn't seem so, as only variables that are used inside thread is global *server* and local port
15:02:39
troydm
basicly what I'm doing is debugging why https://github.com/cxxxr/cl-lsp is not working on MacOS as expected, as when I start cl-lsp with args tcp 10003
15:04:15
troydm
but it doesn't seems like it's something cl-lsp related, more probably related to jsonrpc and bordeaux-threads
15:45:37
troydm
it seems like jsonrpc is designed this way that when you bind a server on tcp it needs to load (ql:quickload "jsonrpc/transport/tcp" :silent t)
16:26:19
SpaceIgor2075
Hello! Can anybody recommend any resources to learn about modules,packages, asdf and projects? i am a newbie
16:27:23
phoe
once you've absorbed this document and played in the REPL with the knowledge you've gained this way, please come back for a bit more about ASDF, systems, and projects
16:32:33
Xach
i don't like its POV of "isn't this dumb system dumb? well, here's how it works" - I'd prefer an explanation from someone with less contempt for it.
16:33:53
beach
Xach: It's OK. I see Alexandria fixed the incorrect clause order. That's all I need for now.
16:34:33
Xach
beach: whenever i increase strictness (by updating my sbcl), something that is 5-10 years since last maintenance breaks
16:34:58
Xach
the current problem is a widely-used library named "access" which uses function designators wrong
16:35:36
phoe
Xach: is it possible for you to also test on high safety/debug settings? this exposes bugs that are not exposed otherwise, like this cl-unicode bug that I just encountered
16:47:52
phoe
I assume that is why this cl-unicode issue was not noticed by Xach when preparing the QL distribution
16:51:09
heisig
In case anyone is wondering, the correct way to restrict SBCL's compiler policy is (sb-ext:restrict-compiler-policy 'safety 3).
17:11:00
VincentVega
guys, i am reading the cl-containers docs for red-black trees and don't get one thing: is there really no function to find the closest element to a given or am i just not seeing it?
17:11:04
VincentVega
https://common-lisp.net/project/cl-containers/documentation/metabang.cl-containers-package/class-red--black--tree.html
17:27:32
ck_
yes, looks that way. It depends on what you mean by 'closest' then. If you're looking for something like a range test for the ordering that the tree uses.. well I don't see one either
17:35:03
ck_
if you need this type of look-up often or mostly, maybe a different data structure would be a better choice
18:21:29
benjamindc
IS there a way to get "(asdf:test-system "system")" to return an exit code of 1 when executed in a script for CI pipelines?
18:24:47
phoe
benjamindc: the convention is generally that if asdf:test-system signals an error, then it has failed
18:25:56
phoe
so you can do it like (handler-bind ((error (lambda (x) (print x) (print stacktrace) (exit 1)))) (asdf:test-system :foo) (exit 0))
18:29:28
aeth
benjamindc: In general, just ignore asdf:test-system in CI pipelines and just directly use the non-portable return value of whatever test suite you're using. ASDF doesn't want to have asdf:test-system return a non-portable return value, making it near-useless for CI
18:29:58
aeth
phoe's answer is the correct answer, but it winds up being like 5 lines of code just to return something that your test suite already returns that asdf:test-system is blocking...
18:34:15
aeth
benjamindc: Sorry, phoe's answer is almost the correct answer. You want to exit with (uiop:quit 1)
18:34:49
aeth
no, but I'm not very happy with any of them having used almost all of them in different projects of mine over the years