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/>
shoggouth has quit [Quit: Connection closed for inactivity]
mailman has quit [Quit: Client closed]
mailman has joined #commonlisp
amb007 has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 268 seconds]
mailman83 has joined #commonlisp
Lord_of_Life has joined #commonlisp
amb007 has quit [Ping timeout: 260 seconds]
mailman83 has quit [Client Quit]
varjag has quit [Ping timeout: 240 seconds]
mailman has quit [K-Lined]
random-nick has quit [Ping timeout: 268 seconds]
FragmentedCurve has quit [Remote host closed the connection]
rtypo has quit [Ping timeout: 268 seconds]
ethanxxxl has quit [Ping timeout: 260 seconds]
nickiminjaj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tok has quit [Remote host closed the connection]
jon_atack has quit [Ping timeout: 268 seconds]
jonatack has joined #commonlisp
psilord has quit [Ping timeout: 268 seconds]
jonatack has quit [Ping timeout: 264 seconds]
decweb has joined #commonlisp
whartung has joined #commonlisp
jonatack has joined #commonlisp
decweb has quit [Ping timeout: 240 seconds]
istewart has joined #commonlisp
jon_atack has joined #commonlisp
decweb has joined #commonlisp
st_aldini has quit [Ping timeout: 256 seconds]
jonatack has quit [Ping timeout: 260 seconds]
contrapunctus has left #commonlisp [#commonlisp]
decweb has quit [Ping timeout: 240 seconds]
whartung has quit [Quit: Leaving.]
kevingal has quit [Ping timeout: 264 seconds]
yitzi has quit [Remote host closed the connection]
bjorkint0sh has quit [Quit: "Every day, computers are making people easier to use." David Temkin]
bjorkintosh has joined #commonlisp
Pixel_Outlaw has joined #commonlisp
ronald_ has joined #commonlisp
ronald has quit [Ping timeout: 268 seconds]
ronald_ has quit [Ping timeout: 256 seconds]
synchromesh has quit [Read error: Connection reset by peer]
synchromesh has joined #commonlisp
ronald has joined #commonlisp
psilord has joined #commonlisp
skeemer has quit [Ping timeout: 264 seconds]
decweb has joined #commonlisp
ronald_ has joined #commonlisp
ronald has quit [Ping timeout: 256 seconds]
decweb has quit [Ping timeout: 256 seconds]
st_aldini has joined #commonlisp
istewart has quit [Quit: Konversation terminated!]
wacki has joined #commonlisp
contrapunctus has joined #commonlisp
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 260 seconds]
markb1 has quit [Ping timeout: 260 seconds]
markb1 has joined #commonlisp
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
chomwitt has joined #commonlisp
X-Scale has quit [Ping timeout: 250 seconds]
chomwitt has quit [Ping timeout: 268 seconds]
pve has joined #commonlisp
<mrcom> Sanity check, please. No (portable) way to do automatic forward declarations in COMPILE, correct?
<mrcom> e.g., you can compile-file a file with "(defun foo () (baz x)) (defun baz () ...)", withoug "undefined function" warnings in foo.
<beach> You shouldn't get any warnings from that anyway.
<beach> If a function is used before it is defined in a file, then there should be no warning.
<beach> ... provided it is defined in the same file.
<mrcom> (compile nil '(lambda () (defun foo () (baz x)) (defun baz () ...))) gives errors.
<mrcom> Right, compile-file in same file is good.
<beach> But COMPILE is not COMPILE-FILE.
<mrcom> Right.
<mrcom> And I'm not missing a trick in getting COMPILE to do that, right?
<beach> You can sort of do it...
<beach> If you proclaim an FTYPE, it kind of works as a forward declaration.
<mrcom> Yeah.
<beach> And if BAZ is a generic function you can do a DEFGENERIC first.
<mrcom> That's all I could think of, too.
<beach> And your use case is kind of strange, because you typically use DEFUN only as a top-level form.
<mrcom> I'm writing a temporary-definitions macro for unit tests.
<beach> It would be more common to see LABELS used.
<mrcom> For some stuff I'm testing in McCLIM, actually.
<mrcom> I want to fire up a unit test, define the application, etc., and have it all go away at the end.
<mrcom> Ready for the next unit in the suite...
dinomug has quit [Remote host closed the connection]
<mrcom> It's kind of messy, and a pain, to manually include fmakunbound, etc. in the unit. Plus you've got to memoize defmethod results to be able to remove the right method.
<mrcom> So hey, how hard could it be to just wait for definitions and roll them back?
<mrcom> Well, I found out how hard.
<mrcom> More fiddly than I expected, but not too bad.
<mrcom> s/wait for/watch for/
<aeth> if it works for a file, maybe write to /tmp/ and compile the file?
<mrcom> Bingo.
<aeth> In fact, that seems to be what C-c C-c in SLIME+Emacs does because if you get errors it's for a .lisp file in /tmp/ iirc
<mrcom> I just didn't want to do that and have somebody point out the easy thing I overlooked.
<mrcom> Oh, that's good to know.
<aeth> I just confirmed it; if I C-c C-c a file foo.lisp that consists solely of (+ "hi") then I get an error that it's in file /tmp/slimeRLMKNe
<aeth> for the SLIME expression compilation... file C-c C-k would obviously know the correct file
<beach> mrcom: Does it help to surround the COMPILE with WITH-COMPILATION-UNIT?
<mrcom> Nope.
<mrcom> Kind of makes sense... COMPILE seems to be aimed at making individual functions more efficient.
<mrcom> Since the body has to be wrapped in a lambda, it's not even top-level. That alone would probably break auto-forward-decl.
<beach> I guess the warning doesn't happen at compile time, but when the function is run, yes?
<mrcom> No, it's a compile. Run-time is fine, since at that point everything's defined.
<mrcom> None of the (eval-when :compile-toplevel :load-toplevel) stuff runs in COMPILE.
<mrcom> Just :execute.
<mrcom> I think that's how SBCL, at least, is doing the forward decls.
<beach> I don't get a warning at compile time for (compile nil '(lambda () (defun foo (x) (bar x)) (defun bar (x) x)))
<beach> And I probably shouldn't.
<mrcom> In SBCL?
<beach> Yes.
<mrcom> Hmm. I'm not either, when just run in bare repl.
<mrcom> Safety, maybe?
<beach> I have safety 3.
rgherdt has joined #commonlisp
<mrcom> Hm........
<mrcom> OK, something to figure out. Glad I asked, and thanks.
<beach> Sure.
Pixel_Outlaw has quit [Quit: Leaving]
King_julian has joined #commonlisp
<mrcom> OK, it's defmethod.
<mrcom> ,(compile nil '(lambda () (defun baz (x) (blurk x)) (defmethod blurk ((x fixnum)) (1+ x))))
<ixelp> ;Compiler warnings : ↩ ; In BAZ inside an anonymous lambda form: Undefined function BLURK ↩ => #<Anonymous Function #x1441186E>; T; NIL
<mrcom> Oddly enough, no "implicit defgeneric".
<mrcom> In either SBCL or CCL.
<mrcom> compile-file on sbcl does not give a warning about undefined func blurk.
_cymew_ has joined #commonlisp
<mrcom> ,(compile nil '(lambda () (defvar x1 nil) (defun x2 () x1)))
<ixelp> ;Compiler warnings : ↩ ; In X2 inside an anonymous lambda form: Undeclared free variable X1 ↩ => #<Anonymous Function #x14414C36>; T; T
<mrcom> Similar on SBCL. compile-file is giving same error.
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
<mrcom> ...but not if defvar and defun are top-level.
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
danse-nr3 has joined #commonlisp
synchromesh has quit [Ping timeout: 256 seconds]
synchromesh has joined #commonlisp
donleo has joined #commonlisp
thonkpod_ has quit [Ping timeout: 246 seconds]
thonkpod_ has joined #commonlisp
nybble has quit [Quit: WeeChat 4.2.2]
rendar has quit [Quit: Leaving]
rendar has joined #commonlisp
dino_tutter has joined #commonlisp
waleee has joined #commonlisp
danse-nr3 has quit [Remote host closed the connection]
danse-nr3 has joined #commonlisp
metsomedog has joined #commonlisp
makomo has joined #commonlisp
mgl_ has joined #commonlisp
pfdietz has quit [Quit: Client closed]
yitzi has joined #commonlisp
awlygj has joined #commonlisp
<flip214> Does somebody know how many remote participants were on the Jitsi instance for ELS24?
msavoritias has joined #commonlisp
aciep has joined #commonlisp
cage has joined #commonlisp
chomwitt has joined #commonlisp
random-nick has joined #commonlisp
rtypo has joined #commonlisp
danse-nr3 has quit [Ping timeout: 260 seconds]
boogsbunny has joined #commonlisp
varjag has joined #commonlisp
chomwitt has quit [Ping timeout: 268 seconds]
danse-nr3 has joined #commonlisp
rtypo has quit [Quit: WeeChat 4.2.2]
waleee has quit [Ping timeout: 264 seconds]
puke has joined #commonlisp
puke has quit [Max SendQ exceeded]
rtypo has joined #commonlisp
puke has joined #commonlisp
waleee has joined #commonlisp
puke has quit [Max SendQ exceeded]
jon_atack has quit [Ping timeout: 264 seconds]
puke has joined #commonlisp
puke has quit [Max SendQ exceeded]
jonatack has joined #commonlisp
puke has joined #commonlisp
decweb has joined #commonlisp
danse-nr3 has quit [Ping timeout: 268 seconds]
danse-nr3 has joined #commonlisp
ronald_ has quit [Ping timeout: 264 seconds]
chomwitt has joined #commonlisp
ronald has joined #commonlisp
ronald_ has joined #commonlisp
ronald has quit [Read error: Connection reset by peer]
yitzi has quit [Ping timeout: 240 seconds]
yitzi has joined #commonlisp
synchromesh has quit [Read error: Connection reset by peer]
synchromesh has joined #commonlisp
thollief has joined #commonlisp
chomwitt has quit [Ping timeout: 240 seconds]
X-Scale has joined #commonlisp
pfdietz has joined #commonlisp
King_julian has quit [Ping timeout: 268 seconds]
<pfdietz> mrcom: that's working as intended.  The defvar form is not in a top level context, so it is only evaluated when the method is called, not when it is compiled.
<beach> I don't think it is evaluated at compile time when it's a top-level form either.
edgar-rft_ has joined #commonlisp
King_julian has joined #commonlisp
edgar-rft has quit [Ping timeout: 240 seconds]
<pfdietz> Yes.  I meant that the declaration of the variable as special must be recognized by the compiler.  Thank you for the correction.
<beach> Yes, that. :)
hayley has quit [Read error: Connection reset by peer]
jonatack has quit [Ping timeout: 268 seconds]
jonatack has joined #commonlisp
hayley has joined #commonlisp
yitzi has quit [Ping timeout: 260 seconds]
yitzi has joined #commonlisp
pranav has quit [Read error: Connection reset by peer]
aciep has quit [Remote host closed the connection]
tok has joined #commonlisp
chomwitt has joined #commonlisp
son0p has joined #commonlisp
yitzi has quit [Remote host closed the connection]
X-Scale has quit [Quit: Client closed]
pranav has joined #commonlisp
josrr has joined #commonlisp
varjag has quit [Quit: ERC (IRC client for Emacs 27.1)]
chomwitt has quit [Ping timeout: 256 seconds]
reb has quit [Remote host closed the connection]
danse-nr3 has quit [Ping timeout: 252 seconds]
jonatack has quit [Ping timeout: 252 seconds]
edgar-rft_ is now known as edgar-rft
jonatack has joined #commonlisp
pfdietz has quit [Quit: Client closed]
X-Scale has joined #commonlisp
ronald_ has quit [Ping timeout: 264 seconds]
msavoritias has quit [Ping timeout: 260 seconds]
ronald has joined #commonlisp
danse-nr3 has joined #commonlisp
ronald has quit [Read error: Connection reset by peer]
ronald_ has joined #commonlisp
pfdietz has joined #commonlisp
awlygj has quit [Ping timeout: 240 seconds]
Alfr has quit [Quit: Leaving]
danse-nr3 has quit [Read error: Connection reset by peer]
danse-nr3 has joined #commonlisp
rgherdt_ has joined #commonlisp
rgherdt has quit [Ping timeout: 240 seconds]
wacki has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
Alfr has joined #commonlisp
danse-nr3 has quit [Remote host closed the connection]
attila_lendvai has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
whartung has joined #commonlisp
semarie has quit [Quit: WeeChat 4.2.2]
whartung has quit [Quit: Leaving.]
thuna` has joined #commonlisp
whartung has joined #commonlisp
semarie has joined #commonlisp
jmercouris1 has joined #commonlisp
King_julian has quit [Ping timeout: 268 seconds]
attila_lendvai has quit [Ping timeout: 268 seconds]
wacki has joined #commonlisp
jmercouris1 has quit [Quit: jmercouris1]
whartung has quit [Quit: Leaving.]
whartung has joined #commonlisp
craigbro has quit [Remote host closed the connection]
tursom has quit [Ping timeout: 246 seconds]
tursom has joined #commonlisp
mgl_ has quit [Ping timeout: 264 seconds]
msavoritias has joined #commonlisp
attila_lendvai has joined #commonlisp
nybble has joined #commonlisp
msavoritias has quit [Ping timeout: 256 seconds]
lucasta has joined #commonlisp
X-Scale has quit [Quit: Client closed]
lucasta has quit [Quit: Leaving]
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
<yottabyte> I've been using yason, but yason:encode seems to return a hash-table for me, I want it to return a string. I've tried using format with it but that doesn't seem to do the trick either
<yottabyte> it's not beyond the realm of possibilities that I'm doing it incorrectly, though...
alcor has joined #commonlisp
wacki has quit [Read error: Connection reset by peer]
jonatack has quit [Ping timeout: 256 seconds]
wacki has joined #commonlisp
kiyafirs has joined #commonlisp
whartung has quit [Quit: Leaving.]
mgl_ has joined #commonlisp
mgl_ has quit [Ping timeout: 260 seconds]
jonatack has joined #commonlisp
yitzi has joined #commonlisp
<yitzi> yottabyte: Thats as expected. It returns the object and encodes to the stream.
wacki has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
eddof13 has joined #commonlisp
wacki has joined #commonlisp
contrapunctus has left #commonlisp [#commonlisp]
pranav has quit [Read error: Connection reset by peer]
contrapunctus has joined #commonlisp
<josrr> yottabyte: you can use yason:with-output-to-string*
<josrr> (yason:with-output-to-string* () (yason:encode t))
josrr has quit [Remote host closed the connection]
eddof13 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
ethanxxxl has joined #commonlisp
earl-ducaine_ has joined #commonlisp
grinton has quit [Ping timeout: 260 seconds]
contrapunctus has left #commonlisp [#commonlisp]
contrapunctus has joined #commonlisp
ethanxxxl has quit [Ping timeout: 272 seconds]
earl-ducaine_ has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
contrapunctus has left #commonlisp [#commonlisp]
contrapunctus has joined #commonlisp
jonatack has quit [Ping timeout: 260 seconds]
jonatack has joined #commonlisp
yitzi has quit [Remote host closed the connection]
jmdaemon has joined #commonlisp
thollief has quit [Quit: Leaving]
pranav has joined #commonlisp
FragmentedCurve has joined #commonlisp
kevingal has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 29.3]
jmdaemon has quit [Ping timeout: 255 seconds]
_cymew_ has quit [Ping timeout: 260 seconds]
jrx has joined #commonlisp
BierLiebHaber has joined #commonlisp
jrx has quit [Quit: Bye]
jmdaemon has joined #commonlisp
shka has quit [Quit: Konversation terminated!]
rgherdt_ has quit [Quit: Leaving]
whartung has joined #commonlisp
wacki has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
alcor has quit [Ping timeout: 252 seconds]
wacki has joined #commonlisp
wacki has quit [Client Quit]
attila_lendvai has quit [Ping timeout: 260 seconds]
metsomedog has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.3)]
earl-ducaine has joined #commonlisp
rgherdt has joined #commonlisp
amb007 has quit [Ping timeout: 260 seconds]
whartung has quit [Quit: Leaving.]
rgherdt has quit [Quit: Leaving]
synchromesh has quit [Read error: Connection reset by peer]
synchromesh has joined #commonlisp
jmdaemon has quit [Ping timeout: 272 seconds]
varjag has joined #commonlisp
skeemer has joined #commonlisp
dino_tutter has quit [Ping timeout: 256 seconds]
<varjag> is there an elegant way to shiftf/rotatef the first n elements of a list?
daox has joined #commonlisp
daox has quit [Ping timeout: 240 seconds]
<ixelp> Rotating Arrays (Part I) | Harder, Better, Faster, Stronger
<_death> well, these are for arrays
<aeth> most things work on sequences
<varjag> not necessarily as efficiently
<_death> for a list you might keep a reference to the last cons and detach/reattach as needed
<varjag> guess i just shuffle conses by hand
<aeth> shiftf and rotatef are part of §5.3 The Data and Control Flow Dictionary so it's not entirely clear... looks like they work on places, so cadrs and stuff
<_death> there's alexandria:rotate though I don't remember how it's implemented
<varjag> hmm
contrapunctus has left #commonlisp [#commonlisp]
<varjag> nah it can't be composed to rotate the head efficiently
conjunctive has quit []
lucasta has joined #commonlisp
<gilberth> ,(let ((x (list 1 2 3 4 5 6 7 8 9))) (shiftf (cdr x) (cdr (nthcdr 2 x)) x)) ;a starting point
<ixelp> => (2 3 1 4 5 6 7 8 9)
<gilberth> Surprisingly NTHCDR itself is not a place.
<varjag> oh nice
ethanxxxl has joined #commonlisp
<thuna`> ,(nthcdr 4 '(1 2))
<ixelp> (nthcdr 4 '(1 2)) => NIL
lucasta has quit [Ping timeout: 240 seconds]
<thuna`> It's not immediately obvious what (SETF NTHCDR) would do in such a situation. If you decide to treat it as equivalent to (SETF (CDR (NTHCDR (1- N) ...)) ...) then you need to special-case (SETF (NTHCDR 0 ...) ...) which is not as bad as it gets but not particularly nice either.
<gilberth> Oh, right.
<remexre> is there an optimized count-trailing-zeroes (that compiles to one instruction for fixnums) for SBCL? (or ideally some trivial-* package that does the slow thing for impls that don't have an optimized builtin)
tok has quit [Remote host closed the connection]
donleo has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
<pfdietz> (setf (nthcdr 0 <place>)  <val>) would just be equivalent to (setf <place> <val>).     The key is that the argument has to be a place.
symdrome has joined #commonlisp
amb007 has quit [Ping timeout: 268 seconds]
<gilberth> It would make for an interesting setf expander.
<shawnw> You might be able to use https://pvk.ca/Blog/2014/08/16/how-to-define-new-intrinsics-in-sbcl/ as a starting point for creating an intrinsic for tzcnt
<ixelp> How to define new intrinsics in SBCL - Paul Khuong: some Lisp
<gilberth> Isn't (1- (integer-length (logxor x (1- x)))) fast enough?
pve has quit [Quit: leaving]
ethanxxxl has quit [Ping timeout: 240 seconds]
<remexre> gilberth: ah, that's a bitwise trick i didn't know
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp