<beach>
copec: Whether an expression is considered a Boolean or not has to do with intent. SET-GET-ELEMENT is clearly not a Boolean function. It is a function that gets an element, or returns some default value if the element does not exist.
<beach>
copec: It so happens that this default value is NIL, but your code should still treat the default value as exactly that. So you can use NULL to test that, or you can create your own function like DEFAULT-ELEMENT-P. In both cases you convert a default value to a Boolean.
<beach>
copec: Or, you can test it the other way around, of course, like REAL-ELEMENT-P.
<beach>
Guest74: The style guide is definitely not about avoiding generalized Booleans. Again, it is about intent.
Catie has quit [Quit: rcirc on GNU Emacs 29.0.50]
<beach>
I can write (if (member ...) ...) when I want to check whether an element is a member of a list. Or (let ((cell (member ...))) (if (null cell) ...) when I want to use MEMBER to access an element.
semz has quit [Ping timeout: 268 seconds]
ym has quit [Ping timeout: 268 seconds]
semz has joined #commonlisp
waleee has quit [Ping timeout: 268 seconds]
namasteaks has joined #commonlisp
karlosz has joined #commonlisp
ahlk has quit [Read error: Connection reset by peer]
s-liao has quit [Ping timeout: 256 seconds]
ahlk has joined #commonlisp
s-liao has joined #commonlisp
taiju has quit [Remote host closed the connection]
taiju has joined #commonlisp
pillton has joined #commonlisp
Jing has joined #commonlisp
karlosz has quit [Quit: karlosz]
s-liao has quit [Ping timeout: 256 seconds]
karlosz has joined #commonlisp
wilfred has joined #commonlisp
taiju has quit [Ping timeout: 260 seconds]
karlosz has quit [Quit: karlosz]
bilegeek has quit [Quit: Leaving]
CaCode_ has joined #commonlisp
shka has joined #commonlisp
cosimone has joined #commonlisp
dec0d3r has quit [Remote host closed the connection]
karlosz has joined #commonlisp
rgherdt has joined #commonlisp
mfiano has joined #commonlisp
taiju has joined #commonlisp
CaCode has joined #commonlisp
mfiano has quit [Remote host closed the connection]
CaCode_ has quit [Ping timeout: 268 seconds]
cosimone has quit [Quit: ERC (IRC client for Emacs 27.1)]
cosimone has joined #commonlisp
gaqwas has joined #commonlisp
kadir has joined #commonlisp
igemnace has quit [Ping timeout: 268 seconds]
s-liao has joined #commonlisp
s-liao has quit [Client Quit]
CaCode has quit [Remote host closed the connection]
CaCode has joined #commonlisp
igemnace has joined #commonlisp
aartaka has quit [Ping timeout: 260 seconds]
s-liao has joined #commonlisp
s-liao has quit [Client Quit]
s-liao has joined #commonlisp
CaCode has quit [Quit: Leaving]
gaqwas has quit [Ping timeout: 268 seconds]
hendursa1 has joined #commonlisp
hendursaga has quit [Ping timeout: 276 seconds]
rotateq has joined #commonlisp
pillton has quit [Ping timeout: 260 seconds]
taiju has quit [Ping timeout: 260 seconds]
Nilby has joined #commonlisp
wilfred has quit [Quit: Connection closed for inactivity]
scymtym has quit [Ping timeout: 268 seconds]
taiju has joined #commonlisp
zacque has quit [Ping timeout: 268 seconds]
perrierjouet has joined #commonlisp
heisig has joined #commonlisp
karlosz has quit [Quit: karlosz]
scymtym has joined #commonlisp
heisig has quit [Client Quit]
treflip has joined #commonlisp
kevingal has joined #commonlisp
perrierjouet has quit [Quit: WeeChat 3.3]
perrierjouet has joined #commonlisp
pranavats has left #commonlisp [#commonlisp]
kevingal has quit [Remote host closed the connection]
s-liao has quit [Ping timeout: 256 seconds]
pranavats has joined #commonlisp
abrantesasf has joined #commonlisp
attila_lendvai has joined #commonlisp
Everything has joined #commonlisp
Alfr has quit [Quit: Leaving]
Lycurgus has joined #commonlisp
perrierjouet has quit [Quit: WeeChat 3.3]
perrierjouet has joined #commonlisp
zacque has joined #commonlisp
Devon has joined #commonlisp
Lycurgus has quit [Quit: Exeunt]
abrantesasf has quit [Remote host closed the connection]
tyson2 has joined #commonlisp
varjag has joined #commonlisp
Jing has quit [Remote host closed the connection]
Jing has joined #commonlisp
<varjag>
mm copilot almost works on cl
<varjag>
sorta
<varjag>
tries to sneak in occasional emacs-lisp
Jing has quit [Remote host closed the connection]
s-liao has joined #commonlisp
Jing has joined #commonlisp
<Jing>
Hi, I'm using a proxy so that I could download from quicklisp faster. But it often prints "Connection reset by peer (error #54) during read". I was wondering that was there any way to fix this? I searched online but one of the solutions requires me to set up something during installation...
<hayley>
What sort of a proxy is that?
<Jing>
shadowsocks
<hayley>
How does it make downloading from Quicklisp faster? Usually proxies make things slower.
<hayley>
Also, I was not aware that Quicklisp could handle SOCKS proxies. From memory, it can use HTTP proxies, which requires configuration, but not SOCKS.
<Jing>
Configuration after installing (Quicklisp) is also possible?
<hayley>
I think so.
<Jing>
Thank you. I will check it out
s-liao has quit [Quit: Client closed]
tyson2 has quit [Remote host closed the connection]
s-liao has joined #commonlisp
Bike has joined #commonlisp
<lisp123_win>
How big can one file of lisp be to avoid having issues reading / writing?
<pjb>
How would the size of the file have an impact on reading / writing issues?
<lisp123_win>
No idea, just curious if this would be an issue
<pjb>
Well, obviously, if your file starts with an opening parenthesiss, and then contains a sequence of sexp, it cannot be so big as when reading it you would allocate all the RAM!
<lisp123_win>
I'm used to data corruption in other lesser platforms (MS Office)
<pjb>
You need to close the parenthesis before the RAM is full.
<pjb>
But it's the same kind of problem as if you tried to read #1237874301789789789789789798798789789798789798*1010
<pjb>
(there are not 1237874301789789789789789798798789789798789798 free bits in your RAM!)
<lisp123_win>
That makes sense!
<lisp123_win>
On a related topic, is there a way to save only part of a Lisp image?
<lisp123_win>
I'm basically trying to move away from multiple files to some degree for code / data that is not the core program (e.g. tests)
random-nick has joined #commonlisp
heisig has joined #commonlisp
<lisp123_win>
hmm sounds like a bad idea, I will stick to serialisation to files
heisig has quit [Ping timeout: 268 seconds]
<Nilby>
I always just save the middle part of the image, because it's the juiciest. My friend just saves the outside, because it's the crunchiest.
<lisp123_win>
Nilby: Now I'm hungry, time to go out and get a burger
s-liao has quit [Quit: Client closed]
heisig has joined #commonlisp
aartaka has joined #commonlisp
s-liao has joined #commonlisp
heisig has quit [Ping timeout: 268 seconds]
X-Scale has quit [Ping timeout: 260 seconds]
pve has joined #commonlisp
X-Scale` has joined #commonlisp
X-Scale` is now known as X-Scale
nick3000 has joined #commonlisp
abrantesasf has joined #commonlisp
cage has joined #commonlisp
heisig has joined #commonlisp
Everything has quit [Quit: leaving]
heisig has quit [Ping timeout: 268 seconds]
treflip has quit [Remote host closed the connection]
Guest74 has joined #commonlisp
Bike19 has joined #commonlisp
Bike has quit [Killed (NickServ (GHOST command used by Bike19))]
Bike19 is now known as Bike
<Guest74>
beach: that sounds good to me. tbh, i cant find a copy of that style guide and was going off what I thought people said in the past, hence the 'i think'.
waleee has joined #commonlisp
ym has joined #commonlisp
Lycurgus has joined #commonlisp
<beach>
Guest74: The LUV slides you mean? Google "LUV slides Norvig Pitman".
<Guest74>
It's a non trivial find. I think any direct link has dropped off the top search results.
<Guest74>
oh, maybe it's because i'm not using google anymore.
<Guest74>
that should probably be added to some lisp website. There are so many different lisp cookbooks maybe it's already added to one of them. Last one I ran across was 403
Alfr has joined #commonlisp
attila_lendvai has quit [Ping timeout: 256 seconds]
s-liao has quit [Quit: Client closed]
rotateq has quit [Quit: ERC (IRC client for Emacs 26.3)]
<beach>
But as with everything else, one should not follow rules without understanding the reason for their existence.
<beach>
In this case, the reason is to make life easier for the people reading and trying to understand your code (which might be yourself a few days after writing it), so it is important to follow conventions, and to make it possible to understand the code fast, without requiring the reader to remember many things simultaneously.
zacque has quit [Quit: Goodbye :D]
<Guest74>
I'm starting to think developers should have apprentices that learn by writing the documentation for a product.
<beach>
That's why we handle the base case first, so that the reader doesn't have to worry that the base case it not handled after all the code that handles the other case.
<Guest74>
I've read to much documentation where the developer assumes the reader has so much knowledge of the internals.
<beach>
That's also why we use the "most specific construct" rule.
<Guest74>
s/to/too
<beach>
Well, there are certain things the reader must know. If the code is that of a compiler, there is no point in reading it unless the reader knows something about how compilers work.
<beach>
That's another rule by the way. One should avoid too much "noise", i.e., code or comments that could be avoided, given what a typical reader knows.
<beach>
Every good style guide is a product of these basic considerations.
<Guest74>
Perhaps it's my missing knowledge of how C is serialized, but I have constant problems with documentation of network protocols.
<beach>
C is serialized?
thmprover has joined #commonlisp
<Guest74>
for network protocols, sometimes. Finding out how has been my latest problem for this sane protocol.
<Guest74>
the documentation for the network protocol that was copy pasted from the api documentation isn't much help.
<beach>
Guest74: C is just text. It is already serialized.
<Guest74>
I'm sorry if you don't know what I mean, I'm not a programmer.
<beach>
copec: I don't understand your qustion.
<beach>
*question
<copec>
Instead of set-get-element, would that be acceptable style for anaphoric macro?
<beach>
Why is it anaphoric? I don't see any trace of that.
<copec>
That's what you said the other day, about my use of it
<beach>
copec: SET-GET-ELEMENT is fine. It is just that it returns either an element or a default value.
<beach>
Not a Boolean.
<copec>
If I know it returns the element or nil, would that considered acceptable style?
<beach>
copec: No, I said that anaphoric macros are bad in general, because they violate the rules. I didn't refer to your code.
<beach>
copec: Yes. I am not making myself clear. Let me see if I can explain...
<beach>
copec: So you have (SET-GET-ELEMENT ...) and you want to know whether it returned a real element, or the default value (which happens to be NIL).
<beach>
Suppose you want to do something only if it is a real element, and nothing if it is the default.
* copec
listens intently
<beach>
Then you can write (let ((element (set-get-element...))) (unless (null element) ...))
<beach>
Because that code means "Unless the default value is returned, do..."
<beach>
But if you write (when element ...) you are using ELEMENT as a Boolean value, and it isn't, morally speaking. It is an element or a default value.
<beach>
Does it make more sense now?
<copec>
Yeah, that makes sense
<beach>
So it's not about semantics. The semantics of the two cases is the same.
<beach>
It is also not about returning T/NIL.
<beach>
It is all about what message you send to the person reading your code.
<copec>
Okay. I follow now. Thanks for the taking the time to explain it to me
<beach>
Sure.
ec has quit [Ping timeout: 276 seconds]
<copec>
So stylistically, does that mean you wouldn't really use alexandria when-let?
<beach>
Here is another way of seeing it. Suppose one day the person maintaining the SET library decides that the default value, instead of being NIL, is something like :NO-VALUE. Then you should really only have to change your own code in a single place.
<beach>
I do not use any anaphoric macros, and that includes WHEN-LET.
<beach>
So, instead of (NULL ELEMENT) you really should define a function DEFAULT-VALUE-P that works just like NULL.
<jackdaniel>
how when-let is an anaphoric macro?
<beach>
So then you have (let ((element (set-get-element ...))) (unless (default-element-p element) ...))
<beach>
Er, maybe it isn't.
<beach>
But it has the same problem.
<beach>
That is, if used correctly, there should be no information in the body.
Josh_2 has quit [Ping timeout: 268 seconds]
ec has joined #commonlisp
Lycurgus has quit [Ping timeout: 256 seconds]
Inline has joined #commonlisp
kadir has left #commonlisp [WeeChat 3.3]
mfiano has joined #commonlisp
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #commonlisp
rogersm has quit [Remote host closed the connection]
Catie has joined #commonlisp
rogersm has joined #commonlisp
rogersm has quit [Read error: Connection reset by peer]
rogersm_ has joined #commonlisp
ec has quit [Ping timeout: 276 seconds]
tyson2 has joined #commonlisp
rogersm_ has quit [Ping timeout: 260 seconds]
tyson2 has quit [Remote host closed the connection]
ec has joined #commonlisp
Alfr has quit [Quit: Leaving]
sonny has joined #commonlisp
ec has quit [Ping timeout: 276 seconds]
Alfr has joined #commonlisp
ec has joined #commonlisp
Skyfire has joined #commonlisp
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
rogersm has quit [Read error: Connection reset by peer]
rogersm_ has quit [Read error: Connection reset by peer]
rogersm has joined #commonlisp
igemnace has quit [Ping timeout: 256 seconds]
rogersm_ has joined #commonlisp
rogersm has quit [Read error: Connection reset by peer]
rogersm_ has quit [Ping timeout: 260 seconds]
heisig has quit [Quit: Leaving]
slyrus has quit [Quit: Leaving]
Jing has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Lycurgus has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
Lycurgus has quit [Quit: Exeunt]
Jing has joined #commonlisp
kadir has joined #commonlisp
Oladon has joined #commonlisp
sonny has quit [Ping timeout: 256 seconds]
kadir has left #commonlisp [WeeChat 3.3]
Oladon1 has joined #commonlisp
ym has quit [Ping timeout: 256 seconds]
Oladon has quit [Ping timeout: 268 seconds]
tyson2 has joined #commonlisp
Jing has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Inline has joined #commonlisp
Guest74 has quit [Quit: Connection closed]
krjst has quit [Ping timeout: 246 seconds]
Mandus_ has quit [Ping timeout: 268 seconds]
Mandus_ has joined #commonlisp
<kagevf>
lisp123_win: "is there a way to save only part of a Lisp image?" maybe use separate *.asd files ... you could have a "production" one and create an image with that + "save lisp and die" or whichever implementation specific equivalent...
<pjb>
lisp123_win: actually, there is a way.
<pjb>
lisp123_win: you can use com.informatimago.common-lisp.heap.heap to copy the lisp objets you want to save into that heap, and save it. Then you can reload it and copy the object back. The advantage is that the heap format is independent from the implementation, so this let you transport lisp objects from one implementation to another. Or to use shared memory (or mmap) to share lisp objects across several lisp implementations.
pve has quit [Quit: leaving]
Mandus_ has quit [Ping timeout: 260 seconds]
Mandus_ has joined #commonlisp
Mandus_ has quit [Ping timeout: 268 seconds]
Mandus_ has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
Mandus_ has quit [Ping timeout: 256 seconds]
kadir has joined #commonlisp
Krystof has quit [Ping timeout: 245 seconds]
krjst has joined #commonlisp
aeth has quit [Ping timeout: 260 seconds]
aeth has joined #commonlisp
Mandus_ has joined #commonlisp
scymtym has quit [Ping timeout: 268 seconds]
kadir has left #commonlisp [good night]
tyson2 has joined #commonlisp
gaqwas has joined #commonlisp
aartaka has quit [Ping timeout: 268 seconds]
aartaka has joined #commonlisp
molson has joined #commonlisp
Krystof has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 27.1]
scymtym has joined #commonlisp
thmprover has quit [Quit: For He Was Great of Heart]
snits has joined #commonlisp
snits has quit [Ping timeout: 260 seconds]
aartaka has quit [Ping timeout: 268 seconds]
Oladon1 has quit [Quit: Leaving.]
sonny has joined #commonlisp
shka has quit [Ping timeout: 256 seconds]
snits has joined #commonlisp
sonny has left #commonlisp [#commonlisp]
azimut_ has quit [Remote host closed the connection]
azimut has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
akoana has joined #commonlisp
dec0d3r has joined #commonlisp
<pjb>
work.
<pjb>
lisp123_win: something like: https://termbin.com/y8zs but this needs some serious debugging… heap uses global special variables and we want to put all that in objects. the pastes does that with wrapper macros. There remain to process correctly the binding of variables saved in the partial lisp images, this may require some patch to heap, perhaps. I can't debug it right now. But the test example let you see how it could
Mandus_ has quit [Ping timeout: 256 seconds]
Mandus_ has joined #commonlisp
cosimone has quit [Quit: ERC (IRC client for Emacs 27.1)]