jackdaniel changed the topic of #commonlisp to: Common Lisp, the #1=(programmable . #1#) programming language | Wiki: <https://www.cliki.net> | IRC Logs: <https://irclog.tymoon.eu/libera/%23commonlisp> | Cookbook: <https://lispcookbook.github.io/cl-cookbook> | Pastebin: <https://plaster.tymoon.eu/>
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
fererrorocher has quit [Quit: WeeChat 4.2.1]
<paulapatience> I actually always write (require "asdf") and it works
random-nick has quit [Ping timeout: 268 seconds]
rtypo has quit [Ping timeout: 260 seconds]
nij- has quit [Ping timeout: 256 seconds]
amb007 has quit [Ping timeout: 256 seconds]
<dbotton> I recently came across an issue where I used a macro earlier in a function in the same file before it was defined later in that same file and that created issues at run-time, other than placing the macro earlier in the file to insure the defmacro is read first is there anything else that can be done to catch such a "user error"?
<paulapatience> You can also define the macro in a different compilation unit, like a different file
<paulapatience> And ensure that it is loaded before
<paulapatience> in the .asd
<dbotton> that is just an alternative solution, I was curious if way to catch such a mistake
<paulapatience> Does SBCL not issue a warning?
jmercouris1 has joined #commonlisp
<dbotton> not that I noticed
pfdietz has quit [Quit: Client closed]
pfdietz has joined #commonlisp
waleee has quit [Ping timeout: 256 seconds]
<paulapatience> What kind of run-time issues did it create, actually? If you are compiling the file, it shouldn't matter if the macro is defined later
jmercouris1 has quit [Client Quit]
<dbotton> it seems to have interpreted one of the parameters as a function
<dbotton> at runtime
<paulapatience> Ah, I suppose it thought what you called was a function, but in fact it was a macro
<dbotton> (with-clog-debugger (clog-body)
<dbotton> clog-body was thought to be a function instead a parameter
<dbotton> (with-clog-debugger (clog-body)
<dbotton> (defmacro with-clog-debugger ((clog-obj) &body body)
<paulapatience> I'm not sure that you can do anything except define your macros earlier
dlowe has quit [Remote host closed the connection]
X-Scale has joined #commonlisp
lucasta has joined #commonlisp
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 256 seconds]
josrr has quit [Remote host closed the connection]
nij- has joined #commonlisp
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
mzan has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
terrorjack has joined #commonlisp
theBlackDragon has quit [Ping timeout: 255 seconds]
theBlackDragon has joined #commonlisp
hayley has joined #commonlisp
chomwitt has joined #commonlisp
<Bubblegumdrop> dbotton eval-when ?
<beach> dbotton: There should have been a warning about an unknown function. Sometimes, if your macro uses some nontrivial syntax, you will get an error then, because the syntax of the form is not a valid function call.
<beach> Oh, wait, maybe there is no warning if it is defined as a macro later.
lucasta has quit [Remote host closed the connection]
<beach> I seem to recall messages such as "Defining FOO as a macro when it was previously assumed to be a function", but I don't remember the context.
nij- has left #commonlisp [Using Circe, the loveliest of all IRC clients]
igemnace has joined #commonlisp
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 255 seconds]
Pixel_Outlaw has joined #commonlisp
emaczen has quit [Remote host closed the connection]
Pixel_Outlaw has quit [Remote host closed the connection]
istewart has quit [Quit: Konversation terminated!]
danza has joined #commonlisp
King_julian has joined #commonlisp
pve has joined #commonlisp
King_julian has quit [Ping timeout: 252 seconds]
jjnkn has joined #commonlisp
jmercouris1 has joined #commonlisp
ec_ has quit [Ping timeout: 260 seconds]
jmercouris1 has quit [Client Quit]
ec_ has joined #commonlisp
wacki has joined #commonlisp
ec_ has quit [Remote host closed the connection]
saturn2 has quit [Ping timeout: 256 seconds]
ec_ has joined #commonlisp
ec_ has quit [Remote host closed the connection]
ec_ has joined #commonlisp
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
saturn2 has joined #commonlisp
bilegeek has joined #commonlisp
monospod has joined #commonlisp
Mandus has quit [Quit: WeeChat 4.1.1]
danza has quit [Ping timeout: 252 seconds]
Mandus has joined #commonlisp
monospod has quit [Remote host closed the connection]
rgherdt has joined #commonlisp
st_aldini1 has joined #commonlisp
st_aldini has quit [Ping timeout: 240 seconds]
st_aldini1 is now known as st_aldini
hayley has quit [Quit: leaving]
King_julian has joined #commonlisp
varjag has joined #commonlisp
amb007 has quit [Remote host closed the connection]
amb007 has joined #commonlisp
varjag has quit [Ping timeout: 240 seconds]
zetef has quit [Ping timeout: 268 seconds]
random-nick has joined #commonlisp
alcor has joined #commonlisp
jon_atack has joined #commonlisp
jonatack has quit [Ping timeout: 252 seconds]
King_julian has quit [Ping timeout: 240 seconds]
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
agm has joined #commonlisp
danse-nr3 has joined #commonlisp
<agm> beach: yes, just evaluate "(defun foo () (bar)) (defmacro bar ())". the compiler assumes that any unknown compound form is a function call, see the first point in clhs 3.2.2.3
poplin has quit [Ping timeout: 256 seconds]
jon_atack has quit [Ping timeout: 246 seconds]
poplin has joined #commonlisp
igemnace has quit [Read error: Connection reset by peer]
poplin has quit [Ping timeout: 255 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
poplin has joined #commonlisp
varjag has joined #commonlisp
King_julian has joined #commonlisp
<beach> Yes, I think I knew that. But the question was whether there is some indication that the compiler made this assumption which then turned out to be not so great.
igemnace has joined #commonlisp
jonatack has joined #commonlisp
<younder> Well (ql:quickload :bike) won't load. I get a error in rwlock. line 32: bt2 does not exist.
<younder> bt2 I am guessing is Bordeaux-threads, but why the 2?
<beach> younder: I think fe[nl]ix announced version 2 some time ago. Check the logs.
iNomad has joined #commonlisp
<ixelp> Bordeaux Threads APIv2 | the fe[nl]ix blog
nij- has joined #commonlisp
jonatack has quit [Ping timeout: 256 seconds]
shka has joined #commonlisp
poplin has quit [Read error: Connection reset by peer]
poplin has joined #commonlisp
<younder> Thanks that worked. Needed to clone bordeaux-threads into local projects and load it. I guess the version in the ql repo is stale.
dino_tutter has joined #commonlisp
poplin has quit [Read error: Connection reset by peer]
poplin has joined #commonlisp
rtypo has joined #commonlisp
danse-nr3 has quit [Remote host closed the connection]
danse-nr3 has joined #commonlisp
msavoritias has joined #commonlisp
donleo has joined #commonlisp
attila_lendvai has joined #commonlisp
danse-nr3 has quit [Ping timeout: 252 seconds]
donleo has quit [Ping timeout: 268 seconds]
danse-nr3 has joined #commonlisp
scymtym has quit [Remote host closed the connection]
scymtym has joined #commonlisp
pfdietz has quit [Quit: Client closed]
zetef has joined #commonlisp
nij- has quit [Ping timeout: 256 seconds]
bilegeek has quit [Quit: Leaving]
Posterdati has quit [Read error: Connection reset by peer]
wacki has quit [Ping timeout: 264 seconds]
donleo has joined #commonlisp
wacki has joined #commonlisp
Posterdati has joined #commonlisp
X-Scale has quit [Quit: Client closed]
<beach> gilberth: I am comparing the dictionary entries for NTH in the Common Lisp HyperSpec and in the Nova Spec. In the Common Lisp HyperSpec, there are sections "Side Effects", "Affected by", "Exceptional Situations", and "Notes" (each containing just "None"), but those are absent in the Nova Spec. Is this deliberate?
nij- has joined #commonlisp
<gilberth> beach: Ask LispWorks. The TeX has no "None" in there either.
<beach> So it doesn't have those section names either?
son0p has joined #commonlisp
<beach> That answers my question. Thank you.
jonatack has joined #commonlisp
King_julian has quit [Quit: leaving]
King_julian has joined #commonlisp
<gilberth> Saying it has no side effects is bold for NTH being an accessor.
<beach> Heh, indeed!
kevingal has joined #commonlisp
jonatack has quit [Ping timeout: 264 seconds]
X-Scale has joined #commonlisp
<beach> gilberth: How are your Common Lisp projects going?
thuna` has quit [Ping timeout: 264 seconds]
Spawns_Carpeting has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
Spawns_Carpeting has joined #commonlisp
jonatack has joined #commonlisp
jonatack has quit [Ping timeout: 255 seconds]
King_julian has quit [Quit: leaving]
King_julian has joined #commonlisp
chrcav has joined #commonlisp
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 260 seconds]
<gilberth> beach: As always those lack documentation. CLEX I consider finished for quite some time. These days I focus on noffi. The parser is pretty robust, struct/union layout is verified against about 10,000 existing header files. So the tedious part is about being done. I still cons and dispatch too much at runtime, so I'll attack that next. However, in overall I'm pretty confident with the API which is the hard part.
<beach> Yeah, sounds good. Don't hesitate to submit draft documentation for proofreading and suggestions of improvement.
Lord_of_Life_ is now known as Lord_of_Life
<gilberth> Ironically, I still believe for Free-CLIM I'll be better off with a display server. Existing GUI toolkits are written towards single-threading and towards running exactly one application. Also ironic: MS Windows is doing it right though.
<beach> I see.
<beach> What prevents the use of a display server?
<gilberth> I need to come up with one. And write one.
<beach> Hmm, yes, I see. You don't want to use X11?
<gilberth> X11? You're joking?
<beach> It is pretty buggy, I know, but it could be a temporary solution.
King_julian has quit [Quit: leaving]
<gilberth> It can't do anti-aliased text, it can't draw an anti-aliased line. It is extremely device dependent. No, thanks.
King_julian has joined #commonlisp
<beach> I see. I was under the impression it could do anti-aliasing.
<gilberth> Kids ruined it. X11 is halfway towards being just a glorified blitterer like Wayland. I don't want to send bitmaps across the wire and I want that the protocol is device-independent.
nij- has quit [Read error: Connection reset by peer]
<beach> I understand.
<gilberth> beach: The RENDER extension can draw triangles and can blitter. That's it.
<beach> OK.
<gilberth> This is why I go FFI. The de facto API is not the wire protocol anymore but libraries like Cairo.
<beach> Yes, I have noticed that. Very sad.
<gilberth> Besides I also want good Cocoa (macos) and MS Windows backend.
<gilberth> beach: It doesn't matter much. What matters is that I don't consider X11 good for remote display anymore.
<beach> I understand.
<gilberth> And remote display is what I want to have.
<gilberth> It's a pity these days you have the bandwidth and reasonable latency at home and could run old core X11 just fine. So you're stuck in the 90s.
<beach> There are lots of problems with the way current computing environments are going.
<gilberth> X11 is broken, mainly because Keith Packard never asked himself why it is possible that he mails PDFs to somebody without asking for the resolution and fonts of that printer that this someone happens to have has.
<gilberth> And also ironically HTML/JS is the new NeWS.
<beach> Wasn't NeWS based on "display postscript" or am I confusing it with something else?
pfdietz has joined #commonlisp
<gilberth> Yes, it was. And hence device independent. I read that you could also deposit PS code on the display server.
<beach> Nice!
<gilberth> It's a pity. Cairo as a graphics API is fine. It implements the PSish graphics model which is so common. Why isn't Cairo an X11 extension? And why haven't fonts be fixed?
<beach> Rhetorical questions, I presume.
<gilberth> And surprisingly Cairo can support the whole general designs of CLIM. Which PS cannot and neither can GDI e.g. PDF sort of can with a few tricks.
easye has joined #commonlisp
<gilberth> beach: You know Keith motivation to rather send bitmaps?
<beach> Nope.
<gilberth> His reasoning was: An X11 application needs to query font metric. And with many fonts and Unicode this adds considerable to start-up time of an application. So he figured that rather sending (and caching) bitmaps of the glyphs used to the server is less traffic and less latency.
<gilberth> It hasn't occurred to him that metrics can be shared information. It is with the PostScript e.g. all the metrics are well-known.
<beach> I see.
<younder> Could you use HTML 5 I mean just wrap a window around webkit? It has harfbuz (truetype) and you get device independence for 'free'
<gilberth> So would go like this. The application would say "Hey server, I am gonna to use 'Times New Roman.ttf' checksum 471130 and call it font #1. Please use font #1 at size 16px and render glyphs 'a' 'b' 'c' at (x,y)."
<gilberth> Then the server would just do that. However, when the server doesn't have that version of that font, it would say "Sorry, can you please provide me a copy of that 'Times New Roman.ttf' with checksum 471130, thanks!"
<gilberth> The server would remember that. Chances are very high that it has this font already. It's probably not the first time you want that font and you're also probably not the only person using that font.
<gilberth> Then the protocol can be device-independent again. The server can scale the font as he wishes. And he could play tricks with subpixels, the application doesn't need to care.
danse-nr3 has quit [Read error: Connection reset by peer]
danse-nr3 has joined #commonlisp
<gilberth> younder: I have a HTML Canvas backend for Free-CLIM and it works nicely. Though I wrote it for the sole purpose to see how a vector-oriented display server protocol would fare. And whether vsync over the wire would work out. This HTML Canvas and JS was a quick way to conduct this experiment.
X-Scale has quit [Quit: Client closed]
<younder> I've noticed ACL moved their entire window interface to the web browser.
<younder> And I've seen VS code.
<gilberth> Another defect of X11: No proper support for double buffering. First the implementation of the double buffer extension is horrible. Second you have no means to get at vsync. And third repaint is asynchronous while you would want to say "please repaint, here's your drawable/gc" and the client would repaint and finally say "Done!".
<gilberth> younder: We'll see. HTML/JS is the new NeWS after all.
<gilberth> But say goodbye to the meta modifier. Maybe they'll fix that. But I doubt that.
<gilberth> And this repaint must be coupled with resizing a top level window. I can't stand any flicker anymore. Every frame should be perfect.
<gilberth> Also: When you're fully device independent you can easily move display of some application about.
<younder> How about WebASM and a CL WebASM compiler? Now it could be written in CL.
<gilberth> younder: That's something else. I was talking about a display server protocol.
<younder> yeah, forget it
<gilberth> I am not up-to-date with GC for WASM and thus don't know whether we could use that.
pfdietz has quit [Quit: Client closed]
<gilberth> Otherwise: Only Webworkers can block. And you cannot interrupt a Webworker. And a WASM program cannot peek at the stack. This leaves you with having your own stack for Lisp data and with polling would you like to multiple threads. GC must be able to interrupt threads. Not using a WebWorker? Forget about it.
X-Scale has joined #commonlisp
<gilberth> younder: The other approach is to embrace CSS and come up with a not-quite-CLIM based on manipulating the DOM instead of display lists (output records). You'd get typesetting for free.
jonatack has joined #commonlisp
<beach> gilberth: Can an alternative display server of your design run at the same time as some other display server like X11? I am not very knowledgeable about graphics.
<beach> ... or would your display server be an X11 client in that situation?
<gilberth> beach: It would not replace your native window system. So with X11 it would be just an X11 application.
<beach> That's what I thought, yes. Thanks.
<beach> Sounds doable.
<gilberth> It sure is. Simple graphics are easy. However, I still want display lists on the server. That's the tricky part.
<beach> Yes, I see.
<gilberth> So that when you scroll a subwindow that can happen w/o network traffic. And using whatever scrollbars are native to your platform.
<beach> I understand.
jonatack has quit [Ping timeout: 256 seconds]
<beach> Sounds like a great project!
<gilberth> Text input is another issue. An <alt> key, <compose> key, some input method, or keyboard layout in general should happen at the display server as well. So it's not just a stream of keycodes. That's too low-level and not device-independent.
<beach> Sure.
<gilberth> That'll get tricky. E.g. when I press <alt-u>, I get ¨ and the cursor is below, and then can type e.g. <a> to make an "ä".
X-Scale has quit [Quit: Client closed]
<gilberth> So it should be possible to write a text editor which still behaves like native text input gadgets. Emacs can do that on the mac. So they must have come up with some abstraction. It gets more wild with Asian scripts.
random-jellyfish has quit [Ping timeout: 255 seconds]
<younder> Emacs started using harfbuz for font layout back in version 27. That is the same as blink uses. so..
<younder> and safari
<gilberth> Yes, another think that I don't want to write myself. atm I still use Pango for X11 and a likewise Cocoa API for macos.
<gilberth> Anyhow, meanwhile I'll focus on noffi. I should grow the habit of actually finishing anything.
X-Scale has joined #commonlisp
King_julian has quit [Ping timeout: 255 seconds]
X-Scale has quit [Quit: Client closed]
poplin has quit [Read error: Connection reset by peer]
<beach> Good resolution.
poplin has joined #commonlisp
jonatack has joined #commonlisp
jonatack has quit [Ping timeout: 246 seconds]
donleo has quit [Ping timeout: 256 seconds]
danse-nr3 has quit [Read error: Connection reset by peer]
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
X-Scale has joined #commonlisp
jonatack has joined #commonlisp
pfdietz has joined #commonlisp
Noisytoot has quit [Remote host closed the connection]
Noisytoot has joined #commonlisp
danse-nr3 has joined #commonlisp
danse-nr3 has quit [Remote host closed the connection]
danse-nr3 has joined #commonlisp
irf has joined #commonlisp
pfdietz has quit [Quit: Client closed]
reb has joined #commonlisp
varjag has quit [Quit: ERC (IRC client for Emacs 27.1)]
reb` has joined #commonlisp
reb has quit [Ping timeout: 260 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
thuna` has joined #commonlisp
lucasta has joined #commonlisp
fererrorocher has joined #commonlisp
cage has joined #commonlisp
nij- has joined #commonlisp
awlygj has joined #commonlisp
lucasta has quit [Quit: Leaving]
lucasta has joined #commonlisp
reb` has quit [Remote host closed the connection]
fererrorocher has quit [Quit: WeeChat 4.2.1]
varjag has joined #commonlisp
lucasta has quit [Remote host closed the connection]
<nij-> How should I deal with UB in common lisp?
<nij-> Never use them? Is that possible?
<paulapatience> What do you mean by UB
<nij-> undefined behavior
<paulapatience> What do you mean by undefined behavior
<nij-> parts in the spec that say "up to the implementation"
<paulapatience> There are some portability libraries that deal with some of that
<beach> nij-: You should always use constructs that are defined in the standard.
<nij-> And if it says "up to the impl", try avoid using it?
<beach> Then try to write your code so that it doesn't matter what the implementation does.
<nij-> got it :)
josrr has joined #commonlisp
Eoco has quit [Ping timeout: 260 seconds]
mm007emko has quit [Ping timeout: 268 seconds]
mm007emko has joined #commonlisp
bjorkintosh has quit [Remote host closed the connection]
Eoco has joined #commonlisp
chomwitt has quit [Ping timeout: 255 seconds]
kevingal has quit [Ping timeout: 268 seconds]
Eoco has quit [Remote host closed the connection]
Eoco has joined #commonlisp
Eoco has quit [Remote host closed the connection]
Eoco has joined #commonlisp
donleo has joined #commonlisp
igemnace has quit [Read error: Connection reset by peer]
ldb has joined #commonlisp
emaczen has joined #commonlisp
bjorkintosh has joined #commonlisp
bjorkintosh has quit [Changing host]
bjorkintosh has joined #commonlisp
danse-nr3 has quit [Ping timeout: 255 seconds]
igemnace has joined #commonlisp
nij- has quit [Ping timeout: 268 seconds]
zetef has quit [Ping timeout: 255 seconds]
yitzi has joined #commonlisp
prokhor has quit [Ping timeout: 240 seconds]
poplin has quit [Ping timeout: 246 seconds]
poplin has joined #commonlisp
yitzi has quit [Remote host closed the connection]
waleee has joined #commonlisp
prokhor has joined #commonlisp
pranav has joined #commonlisp
OlCe has joined #commonlisp
ldb has quit [Ping timeout: 256 seconds]
igemnace has quit [Quit: WeeChat 4.2.1]
nij- has joined #commonlisp
wacki has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
wacki has joined #commonlisp
poplin has quit [Read error: Connection reset by peer]
poplin has joined #commonlisp
waleee has quit [Ping timeout: 260 seconds]
msv has quit [Ping timeout: 255 seconds]
jmercouris1 has joined #commonlisp
mm007emko has quit [Read error: Connection reset by peer]
mm007emko has joined #commonlisp
msv has joined #commonlisp
attila_lendvai has quit [Ping timeout: 256 seconds]
jmercouris1 has quit [Quit: jmercouris1]
nij- has left #commonlisp [Using Circe, the loveliest of all IRC clients]
msv has quit [Ping timeout: 256 seconds]
cage has quit [Quit: rcirc on GNU Emacs 29.2]
varjag has quit [Ping timeout: 268 seconds]
msv has joined #commonlisp
<ecraven> what's the goto-library for reading json?
waleee has joined #commonlisp
josrr has quit [Remote host closed the connection]
zetef has joined #commonlisp
ldb has joined #commonlisp
<ixelp> GitHub - phmarek/yason: Common Lisp JSON serializer written with simplicity in mind
msv has quit [Ping timeout: 252 seconds]
msavoritias has quit [Remote host closed the connection]
alcor has quit [Remote host closed the connection]
varjag has joined #commonlisp
msv has joined #commonlisp
msv has quit [Ping timeout: 255 seconds]
alcor has joined #commonlisp
prokhor has quit [Remote host closed the connection]
jmercouris1 has joined #commonlisp
prokhor has joined #commonlisp
prokhor has quit [Remote host closed the connection]
prokhor has joined #commonlisp
reb has joined #commonlisp
<ecraven> hm.. so I have a 20MB json file, cl-json takes 0.5s, yason takes 1.2s. I only need the first few kb of it. is there a "streaming" mode so that I get events, and can stop the parsing when I have all the information I need?
prokhor has quit [Remote host closed the connection]
<paulapatience> ecraven: There are many JSON libraries: https://sabracrolleton.github.io/json-review
<ixelp> Review of CL JSON Libraries UPDATED 15 May 2023
<paulapatience> You might consider shasht or jzon
<paulapatience> jzon has a streaming mode
<paulapatience> But I've have cases of 20 MiB JSON files not being parseable by jzon, I didn't investigate much
<paulapatience> cl-json iirc is slow compared to shasht or jzon
<ecraven> thanks!
jmercouris1 has quit [Quit: jmercouris1]
jmercouris1 has joined #commonlisp
prokhor has joined #commonlisp
<ecraven> hm.. how do I access nested hash-tables? any convenience functions?
younder has quit [Remote host closed the connection]
<ldb> welp, just use javascript
<paulapatience> The access library
<ixelp> GitHub - AccelerationNet/access: A common lisp library to unify access to common dictionary-like data-structures
mgl has quit [Ping timeout: 260 seconds]
<ecraven> paulapatience: thanks again!
mgl has joined #commonlisp
nij- has joined #commonlisp
poplin has quit [Read error: Connection reset by peer]
chomwitt has joined #commonlisp
mariari has quit [Ping timeout: 268 seconds]
nij- has quit [Remote host closed the connection]
nij- has joined #commonlisp
jjnkn has quit [Remote host closed the connection]
mariari has joined #commonlisp
ldb has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.1)]
jmercouris1 has quit [Quit: jmercouris1]
chomwitt has quit [Ping timeout: 268 seconds]
akoana has joined #commonlisp
msv has joined #commonlisp
msv has quit [Remote host closed the connection]
msv has joined #commonlisp
younder has joined #commonlisp
mgl has quit [Ping timeout: 255 seconds]
flounders has quit [Quit: WeeChat 4.1.2]
nij- has quit [Ping timeout: 272 seconds]
pfdietz has joined #commonlisp
Inline has quit [Quit: Leaving]
alcor has quit [Ping timeout: 268 seconds]
Inline has joined #commonlisp
agm has quit [Ping timeout: 255 seconds]
<childlikempress> is there a way to tell sly to show binary representations for negative numbers?
<childlikempress> and, um, ideally a more useful representation than ,(format nil "~b" -6)
<ixelp> (format nil "~b" -6) => "-110"
amb007 has quit [Ping timeout: 260 seconds]
<paulapatience> Which representation would you want? I don't think CL mandates one
<reb> Maybe something like ,(format nil "~b" (ldb (byte 32 0) -6))
<ixelp> (format nil "~b" (ldb (byte 32 0) -6)) => "11111111111111111111111111111010"
<childlikempress> paulapatience: not sure! but it should definitely include the string 1010
<childlikempress> reb: that's annoying as it requires you to choose a value of 32 (64 maybe more reasonable, but not necessarily sufficient, and at the same time 32 may be excessive)
<bike> you can change 32 to whatever you want
<bike> there's no obvious right bit width here
<childlikempress> the point is to pick some default policy for the repl printout
<childlikempress> perhaps '...1010'
<bike> would -1 print as '...'
<childlikempress> ...1
mathrick has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
hineios2 has quit [Quit: Ping timeout (120 seconds)]
hineios2 has joined #commonlisp
amb007 has quit [Ping timeout: 256 seconds]
Inline has quit [Quit: Leaving]
varjag has quit [Ping timeout: 268 seconds]
shka has quit [Ping timeout: 264 seconds]
zetef has quit [Remote host closed the connection]
<reb> childlikempress: Why do you want to see "1010" somewhere in the output?
X-Scale has quit [Quit: Client closed]
holycow has joined #commonlisp
<childlikempress> because that is a significant bitstring in the binary representation of -6
<childlikempress> so if i want to reason about the number as a bitstring, then that is critical information
<reb> I find it odd that you're interested in the bits of a negative number. When I'm doing bit manipulation, I generally use positive numbers.
X-Scale has joined #commonlisp
<childlikempress> there are lots of well-known applications of negative numbers. for instance (logand x (- x)) to isolate the lowest set bit of x
<childlikempress> for that matter. lognot will _always_ either take or produce a negative number--so its existence is predicated on the assumption that bit manipulation on negative numbers is useful
<reb> I guess I'd call that an application of negation to bit manipulation ...
<childlikempress> ok, so I'm trying to do bit manipulation, and I need negative numbers to do it
<childlikempress> what's the problem?
<reb> I have no problem at all with that.
mathrick has joined #commonlisp
<childlikempress> how will I reason about the negative numbers that are intermediate values in my bit manipulations if I cannot see that -6 has the significant bits 1010?
<reb> I've done it myself. What I've never been concerned with is printing a negative value to see what bits are set.
<childlikempress> ok. but I want to do that
<reb> Generally also when I'm doing bit manipulation, I'm not using bignums, so an LDB expression like the one above works great for debugging.
<childlikempress> and I want to know if there's an easy way to make sly do it automatically when printing negative numbers at the repl
akoana has quit [Quit: leaving]
<reb> Perhaps you can cook up a custom presentation?? ... I've not experimented with them.
szkl has quit [Quit: Connection closed for inactivity]
<reb> It does look like slime-presentations causes every REPL result to be "presented".
<reb> ... the question is whether you can make Emacs present negative integers in a custom way.
reb has quit [Remote host closed the connection]
wacki has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<pfdietz> The binary representations of integers in Common Lisp can be thought of as having an infinite number of bits.   All but a finite number of the bits are 0 for non-negative integers, and 1 for negative integers.
pfdietz has quit [Quit: Client closed]
<Odin-> childlikempress: You talk as if you expect there to be a single, well-defined bit representation of negative numbers.
pfdietz has joined #commonlisp
<childlikempress> Odin-: i do. and, in common lisp, my expectation is satisfied. as pfdietz says
<Odin-> Numbers in one's complement and two's complement are no more negative numbers than they are pixel brightnesses.
<pfdietz> There is the representation implied by the various logical integer functions, but a Common Lisp implementation is not required to use any particular internal representation, as that representation is not itself visible in any standard way.
<childlikempress> Odin-: common lisp specifies two's-complement representation for integers
<pfdietz> This means, for example, that it doesn't matter what kind of computer the Common Lisp is implemented on.  Word size, twos vs. ones complement, none affect what the integer logical functions do.
<childlikempress> implementation details are completely irrelevant here
<Odin-> childlikempress: Well, yes and no. CL specifies that the logical binary operators treat negative numbers _as if_ they were in two's complement. It's a fine distinction, but one that matters quite a bit because two's complement isn't defined without a limited bit width.
<childlikempress> it seems like you are equivocating over the meaning of 'two's-complement'. i don't really care what we take 'two's-complement' to mean, but i don't think there is any ambiguity over the semantics of negative numbers in common lisp
<childlikempress> i remember--this is why i left this channel before
childlikempress has left #commonlisp [#commonlisp]
X-Scale has quit [Quit: Client closed]
dino_tutter has quit [Ping timeout: 256 seconds]
pfdietz has quit [Quit: Client closed]
fe[nl]ix has quit [Quit: Valete!]
rgherdt has quit [Quit: Leaving]
igemnace has joined #commonlisp
fe[nl]ix has joined #commonlisp
donleo has quit [Ping timeout: 256 seconds]
X-Scale has joined #commonlisp
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
pfdietz has joined #commonlisp
Gleefre has joined #commonlisp
josrr has joined #commonlisp
pve has quit [Quit: leaving]
igemnace has quit [Quit: WeeChat 4.2.1]
emaczen has quit [Read error: Connection reset by peer]
Gleefre has quit [Remote host closed the connection]
<paulapatience> There's probably some way to hack sly to do what you want, but not right out of the box
amb007 has quit [Ping timeout: 256 seconds]
jmercouris1 has joined #commonlisp