libera/commonlisp - IRC Chatlog
Search
18:41:32
White_Flame
and of coruse defmacro itself does handle (defmacro do-fancily (var (&key fanciness ...)) ...)
19:23:49
hexology
White_Flame: i also did not know that about defmacro, that i think _really_ solves my problem in this case
19:47:49
_death
to avoid nasty surprises, you should by default take care to evaluate the forms (passed as keyword arguments) in the order specified by the user and only once, if they are to be evaluated at all..
19:48:06
jcowan
pjb: Alists take twice as much space but are normally treated as persistent data structures, whereas plists are normally mutated.
19:52:22
dbotton
So I have hit my first hard crash with sbcl and the following error : Heap exhausted during garbage collection: 16 bytes available, 48 requested.
19:57:38
_death
it's also possible that you're leaking memory (by holding references to stale data) or that you're consing like mad when you probably need not
19:59:13
aeth
it's apparently only 2^30 bytes (i.e. 1 GiB) by default on x86-64 so it should be easy to run out if you're working with a lot of data
20:07:57
pjb
jcowan: a-lists and p-lists take exactly the same space, and have exactly the same access times.
20:09:36
pjb
Nowadays, there may be a slight difference due to cache effect, depending on where the conses are stored. But not depending on the structure.
20:10:28
jcowan
Yes, I withdrew the remark about space. But while you obviously can mutate an alist or use a plist persistently, you generally don't.
23:10:11
gin
aeth: ah! so I have to call (format nil ...) to do it. there is no way to specify a newline escape sequenc in a literal string then?
23:17:43
kakuhen
#\Newline maybe? Not sure if I've ever wanted to do this over simply formatting a string
23:30:06
Bike
gin: if that doesn't suit you, the cl-interpol library provides alternate syntax that lets you use perl escape squences like \n
23:59:59
gin
looks like i have to do (cdr (assoc key alist)) to get the (alist-get key alist) behavior.
1:30:53
hayley
usocket can pick one when creating a server on port 0, then you can query the port it chose.
3:44:36
mathrick
does Trivia have lambda-list matchers (ie. a drop-in replacement for DESTRUCTURING-BIND, where I can use stuff like &OPTIONAL and &KEY)?
3:45:46
Bike
not a trivia expert, but i expect that would need some real complicated semantics to handle lambda list variables that are subpatterns
3:46:33
mathrick
I also don't see a way to replicate (destructuring-bind (head &rest tail) somelist)
3:48:14
mathrick
Bike: possibly, but I'm looking at Trivia to replace my spaghetti piles of D-B / M-V-B / LET, so it's kinda a letdown if it doesn't have a way to do what D-B already does...
3:49:07
mathrick
I might go with metabang-bind, since it seems to have a syntax that's much more like the CL I already know, even though Trivia is the well-maintained community standard