fitzsim has quit [Quit: ERC (IRC client for Emacs 27.1)]
fitzsim has joined #commonlisp
aartaka has quit [Ping timeout: 248 seconds]
aartaka has joined #commonlisp
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
Josh_2 has quit [Ping timeout: 248 seconds]
lottaquestions has quit [Quit: Konversation terminated!]
<jmes>
How would I write to a certain position in a binary stream? For example I open a file with an element size of (unsigned byte 32) and I want to ignore the first 32 bits and overwrite the second 32 bits with a new value.
szkl has quit [Quit: Connection closed for inactivity]
<White_Flame>
oh, yeah I was thinking bytes; it would probably be 1 instead of 4 here because of the element-type of the stream
<jmes>
Oh, perfect! Thanks beach & White_Flame :)
<beach>
Pleasure.
lechner has joined #commonlisp
aartaka has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 252 seconds]
rogersm has joined #commonlisp
amb007 has joined #commonlisp
cage has joined #commonlisp
amb007 has quit [Ping timeout: 256 seconds]
eddof13 has joined #commonlisp
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 256 seconds]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
notzmv has quit [Ping timeout: 256 seconds]
ttree has joined #commonlisp
_cymew_ has joined #commonlisp
jmdaemon has joined #commonlisp
szkl has joined #commonlisp
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
azimut has joined #commonlisp
orestarod has joined #commonlisp
triffid has quit [Quit: triffid]
triffid has joined #commonlisp
McParen has joined #commonlisp
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
<hexology>
is there a nice tidy idiom to parse a list of (:key1 value1 :key2 value2) into an association list or a table/mapping?
<hexology>
and/or is there some function in uiop, alexandria, etc. that can do this using each implementation's own lambda-list parsing logic?
ahlk has quit [Remote host closed the connection]
ahlk has joined #commonlisp
<hexology>
i want to write a macro with an interface like this: (do-fancily x (:fanciness 5 :greatness 3) ...body...) where `x` is a binding, and :fanciness and :greatness are some configuration options
<Bike>
hexology: alexandria has plist-to-alist, i believe
<Bike>
it doesn't use the lambda list logic, but you probably don't want that anyway, unless you really want allow-other-keys semantics i guess?
<hexology>
hm i guess i don't
ahlk has quit [Remote host closed the connection]
<hexology>
that said, i can probably also just leave this as a plist and use getf
<hexology>
is there any reason not to just do that?
<McParen>
Is there in general any advantage of using an alist over a plist?
ahlk has joined #commonlisp
<McParen>
A plist has the nice property that it can be literally passed to make-instance to make an object.
<pjb>
McParen: no advantage. They're requivalent in time and space complexity.
<hexology>
so there isn't really any point in converting to alist here
<pjb>
McParen: by convention, however, plists can have only symbols as keys (indicators), because they're compared with EQ, while assoc uses EQL by default and takes a :test parameter.
robert4242 has quit [Ping timeout: 255 seconds]
<hexology>
in my case that's arguably better anyway
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
<pjb>
Also, there's rassoc, and no equivalent for plists. (that'd have to be (getf (reverse plist) value-indicator).
<pjb>
and that wouldn't be equivalent.
karlosz has joined #commonlisp
<McParen>
Years ago, my vague feeling about plists was that they are somehow "old fashioned", and that "modern" code style should rely more on alists, hashes, and so on. But plists are pretty enjoyable to use.
<pjb>
Within their limitations.
<McParen>
as i said, being able to do (apply #'make-instance 'class plist) is pretty nice.
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 268 seconds]
Lord_of_Life_ is now known as Lord_of_Life
robert4242 has joined #commonlisp
ahlk has quit [Remote host closed the connection]
ahlk has joined #commonlisp
<White_Flame>
and of course, you can destructuring-bind with &key as well
<hexology>
ah, that's also helpful White_Flame
<White_Flame>
and of coruse defmacro itself does handle (defmacro do-fancily (var (&key fanciness ...)) ...)
<White_Flame>
since it destructures deeper than ordinary lambda lists
karlosz has quit [Remote host closed the connection]
ahlk has quit [Remote host closed the connection]
ahlk has joined #commonlisp
pranavats has joined #commonlisp
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
ahlk has quit [Remote host closed the connection]
ahlk has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
anticomputer_ has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
notzmv has joined #commonlisp
<hexology>
White_Flame: i also did not know that about defmacro, that i think _really_ solves my problem in this case
_cymew_ has quit [Ping timeout: 256 seconds]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
igemnace has quit [Remote host closed the connection]
waleee has joined #commonlisp
<_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..
<jcowan>
pjb: Alists take twice as much space but are normally treated as persistent data structures, whereas plists are normally mutated.
<jcowan>
or no, try again
<jcowan>
space is the same
robert4242 has quit [Ping timeout: 244 seconds]
elderK has joined #commonlisp
morganw has joined #commonlisp
<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.
<dbotton>
it is not in my regular code. Any tips ?
<dbotton>
:)
<aeth>
start with more memory?
<dbotton>
do you know off had how? (I am looking up now)
<aeth>
I think it's `--dynamic-space-size`
<aeth>
best guess from the manpage
<aeth>
you can see what it defaults to with (sb-ext:dynamic-space-size)
<dbotton>
that seems to have worked :) thanks
<_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
cage has quit [Quit: rcirc on GNU Emacs 27.1]
<aeth>
strangely, you specify it in megabytes at startup and see what is reserved in bytes
<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
<aeth>
You couldn't even write a web browser with that
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
<pjb>
jcowan: a-lists and p-lists take exactly the same space, and have exactly the same access times.
<pjb>
(setf (cdr (assoc key a-list)) value) is a common idiom.
<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.
<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.
tyson2 has quit [Remote host closed the connection]
McParen has left #commonlisp [#commonlisp]
eddof13 has joined #commonlisp
Oddity has joined #commonlisp
pve has quit [Quit: leaving]
tyson2 has joined #commonlisp
<dbotton>
_death the issue is from mgl-pax when make documentation
<dbotton>
The manual keeps growing in size so, I assume from that
Guest9712 has quit [Quit: WeeChat 3.6]
<_death>
I see.. so aeth's suggestion is a good workaround
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgherdt has joined #commonlisp
morganw has quit [Remote host closed the connection]
eddof13 has joined #commonlisp
rogersm has quit [Quit: Leaving...]
morganw has joined #commonlisp
lottaquestions has joined #commonlisp
masinter has joined #commonlisp
robert4242 has joined #commonlisp
ahlk has quit [Remote host closed the connection]
ahlk has joined #commonlisp
ahlk has quit [Remote host closed the connection]
mariari has quit [Read error: Connection reset by peer]
puchacz has quit [Quit: Client closed]
ahlk has joined #commonlisp
shka has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 268 seconds]
orestarod has quit [Ping timeout: 248 seconds]
n1to has joined #commonlisp
mariari has joined #commonlisp
n1to has quit [Client Quit]
Brucio-61 has quit [Ping timeout: 256 seconds]
causal has joined #commonlisp
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
scymtym has joined #commonlisp
amb007 has joined #commonlisp
Brucio-61 has joined #commonlisp
amb007 has quit [Ping timeout: 268 seconds]
azimut_ has joined #commonlisp
azimut has quit [Ping timeout: 268 seconds]
azimut_ has quit [Remote host closed the connection]
azimut has joined #commonlisp
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
eddof13 has joined #commonlisp
thomaslewis has joined #commonlisp
random-nick has quit [Ping timeout: 252 seconds]
<gin>
Is there the C equivalent of "foo\n" in Common Lisp?
<aeth>
"foo~%" in FORMAT
<aeth>
#.(format nil "foo~%")
thomaslewis has left #commonlisp [#commonlisp]
thomaslewis has joined #commonlisp
<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?
thomaslewis has left #commonlisp [#commonlisp]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
<kakuhen>
#\Newline maybe? Not sure if I've ever wanted to do this over simply formatting a string
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
akoana has joined #commonlisp
robert4242 has quit [Ping timeout: 244 seconds]
ebrasca has quit [Remote host closed the connection]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
<Bike>
gin: you just write an actual newline in the literal
<Bike>
gin: if that doesn't suit you, the cl-interpol library provides alternate syntax that lets you use perl escape squences like \n
<gin>
thx kakuhen, Bike !
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
tyson2 has quit [Remote host closed the connection]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
taiju has joined #commonlisp
eddof13 has joined #commonlisp
eddof13 has quit [Client Quit]
<gin>
common lisp does not have the alist-get (present in emacs lisp)?
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
<masinter>
assoc?
<gin>
looks like i have to do (cdr (assoc key alist)) to get the (alist-get key alist) behavior.