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/>
dcb has quit [Ping timeout: 250 seconds]
NicknameJohn has quit [Ping timeout: 240 seconds]
karlosz has quit [Quit: karlosz]
xaotuk[m] has joined #commonlisp
bitblit1 has joined #commonlisp
NicknameJohn has joined #commonlisp
elevenkb has quit [Remote host closed the connection]
nij- has joined #commonlisp
nij- has quit [Ping timeout: 240 seconds]
nij- has joined #commonlisp
nij- has quit [Ping timeout: 250 seconds]
HamzaShahid has quit [Ping timeout: 240 seconds]
lucasta has joined #commonlisp
random-nick has quit [Ping timeout: 240 seconds]
Guest86 has joined #commonlisp
Guest86 has quit [Client Quit]
nij- has joined #commonlisp
nij- has quit [Read error: Connection reset by peer]
tetsuo9 has quit [Quit: Leaving]
tetsuo9 has joined #commonlisp
semz has quit [Quit: ZNC 1.8.2+deb2build5 - https://znc.in]
lucasta has quit [Ping timeout: 250 seconds]
semz has joined #commonlisp
tyson2 has joined #commonlisp
alcor has quit [Remote host closed the connection]
markb1 has quit [Ping timeout: 256 seconds]
markb1 has joined #commonlisp
NicknameJohn has quit [Ping timeout: 240 seconds]
jeosol has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
triffid has quit [Remote host closed the connection]
skyl4rk has quit [Read error: Connection reset by peer]
skyl4rk has joined #commonlisp
semz has quit [Quit: ZNC 1.8.2+deb2build5 - https://znc.in]
Everything has quit [Ping timeout: 268 seconds]
Everything has joined #commonlisp
notzmv has joined #commonlisp
semz has joined #commonlisp
rgherdt has joined #commonlisp
msavoritias has joined #commonlisp
NicknameJohn has joined #commonlisp
Cymew has joined #commonlisp
amb007 has quit [Ping timeout: 248 seconds]
amb007 has joined #commonlisp
Josh_2 has joined #commonlisp
<Josh_2> hi :trumpet:
<Josh_2> I have a print-object method specialized on a class X that uses ~T, I am trying to now have another print-object for a class Y that has an instance of X within it and I'm using ~S to display it, but how can I tabulate all of the output for X?
<Josh_2> I am not sure if that makes sense
<Josh_2> I use ~T in my print-object for Y to try and tabulate the display of instance X then only the first line is tabulated, I want to move all of the output over 10 spaces
<Josh_2> idk what am doin
<Josh_2> Okay I think I make more clear with example https://plaster.tymoon.eu/view/3819#3819
igemnace has joined #commonlisp
attila_lendvai has joined #commonlisp
Josh_2 has quit [Read error: Connection reset by peer]
Josh_2 has joined #commonlisp
<Josh_2> Is possible?
jeosol has quit [Ping timeout: 245 seconds]
R_Reagan has joined #commonlisp
R_Reagan has left #commonlisp [#commonlisp]
Josh_2 has quit [Ping timeout: 250 seconds]
shka has joined #commonlisp
Inline has joined #commonlisp
masinter_ has joined #commonlisp
masinter has quit [Ping timeout: 250 seconds]
mgl has joined #commonlisp
varjag has joined #commonlisp
Inline has quit [Quit: Leaving]
dnhester90 has joined #commonlisp
<dnhester90> Hi, can anyone help me with a defsystem issue?
<dnhester90> I'm stuck in ASDF system definition failing me. I've tried reading and following examples from other projects to no avail...
<dnhester90> This is the error I'm getting:
<dnhester90> ```lisp
<dnhester90> debugger invoked on a ASDF/ACTION:CIRCULAR-DEPENDENCY in thread
<dnhester90> #<THREAD "main thread" RUNNING {1001100073}>:
<dnhester90>   Circular dependency:
<dnhester90>      ((#<ASDF/LISP-ACTION:LOAD-OP >
<dnhester90>        . #<ASDF/LISP-ACTION:CL-SOURCE-FILE "myproject" "src" "models" "posts">)
<dnhester90>       (#<ASDF/LISP-ACTION:LOAD-OP > . #<ASDF/SYSTEM:SYSTEM "myproject">)
<dnhester90>       (#<ASDF/LISP-ACTION:LOAD-OP >
<dnhester90>        . #<ASDF/COMPONENT:MODULE "myproject" "src">)
<dnhester90>       (#<ASDF/LISP-ACTION:LOAD-OP >
<dnhester90>        . #<ASDF/COMPONENT:MODULE "myproject" "src" "models">))
<dnhester90> ```
<dnhester90> However, in my system definition it's not defined circularly:
<dnhester90> ```lisp
<dnhester90>  :components ((:module "src"
<dnhester90>    :components
<dnhester90> (defpackage myproject.models.posts
<dnhester90>  (:use :cl
<dnhester90>   :datafly
<dnhester90>           :sxql)
<dnhester90>  (:import-from :myproject.config :config)
<dnhester90>  (:import-from :myproject.db :db :with-connection)
<dnhester90>  (:import-from :mito)
<dnhester90>  (:import-from :cl-json)
<dnhester90>  (:import-from :sanity-clause)
<dnhester90>  (:import-from  :myproject.general-utils)
<dnhester90>  (:import-from  :myproject.model)
<dnhester90>  (:import-from  :myproject.model-utils))
<dnhester90> (in-package :myproject.models.posts)
<dnhester90> ```
<dnhester90> Can anyone help me??
<beach> dnhester90: Please use a paste site for more than one line of code.
<dnhester90> Sorry, just noticed it: https://plaster.tymoon.eu/view/3820#3820
<dnhester90> Ah! @beach, how are you? I haven't been here for a while because I was busy with non lisp things, finally I'm back at it, and you helped me a lot a few years ago. Thank you!
<beach> Sure.
<dnhester90> Do you know any good guides (besides the official docs) for learning ASDF? I tried reading through the official docs but it wasn't so helpful in trying to debug my issue of a circular dependency...
<beach> I no of no good guides, unfortunately.
<beach> And, no, it does not have anything to do with package definitions.
<beach> To simplify your ASDF system definition, remove the :DEPENDS-ON and just say :SERIAL T at the top. If it is then still circular, then there is a circular dependency not between components, but between systems. Also, restart your image to make sure there is no stale stuff.
alcor has joined #commonlisp
<dnhester90> @beach thanks, I restarted the image a couple of times. I'll ad the serial option. But does that mean I have to manually set the compile order each time I add a file?
<beach> Yes. You stick the new file in after its dependencies.
<dnhester90> Thanks
<beach> It's not that hard. You will be warned by the compiler if something is undefined when a file is compiled.
pfd has quit [Ping timeout: 245 seconds]
hester has joined #commonlisp
hester has quit [Client Quit]
dnhester26 has joined #commonlisp
LW has joined #commonlisp
<dnhester90> I hear. If it turns out not to be a circular dependency after doing serial, does that mean the implementation of compiling based on system definition is broken? If so, where is it? Can I try to fix it? I haven't done this stuff in a while, but from what I remember it should just be doing depth first search on a Directed Acyclic Graph...
<beach> It means that your system depends on some other system S which in turn depends on your system. Or that S is itself circular.
<beach> If your system depends on no other system, I can't see how there could be any circular dependencies when you use :SERIAL T.
LW has quit [Client Quit]
rgherdt_ has joined #commonlisp
rogersm has joined #commonlisp
rgherdt has quit [Read error: No route to host]
<beach> Oh, sorry, misread...
<beach> If it is not circular after you do :SERIAL T it means that there is circularity in your :DEPENDS-ON, but I just don't see it.
rgherdt_ is now known as rgherdt
<dnhester90> Thanks, that's what I thought... I'm modifying it now to be serial... let's see if it works
m5zs7k has quit [Ping timeout: 240 seconds]
m5zs7k has joined #commonlisp
pve has joined #commonlisp
rainthree has joined #commonlisp
rgherdt_ has joined #commonlisp
rgherdt has quit [Ping timeout: 246 seconds]
Lord_of_Life has quit [Ping timeout: 246 seconds]
Lord_of_Life has joined #commonlisp
rgherdt_ is now known as rgherdt
<dnhester90> @beach finally, it works! Turns out I had a `imports-from` statement in a defpackage in one of the files and that was the source, even though it wasn't the file being mentioned in the compiler error...
<beach> I don't see how ASDF can report a package problem.
<dnhester90> I don't know much about how this works, but I image if a package is being imported by a defpackage it must try to create a reference for that package at compile time for it to be available for any functions or variables used in the current file originating from that package, and that's why it breaks. It could be ASDF defines compile order, and the
<dnhester90> compiler itself when dealing with the defpackafe definitions was giving the error
<dnhester90> Do you usually do serial or depends-on when defining systems?
<dnhester90> is there a preferred practice?
<beach> The error message specifically mentions a circular dependency for ASDF.
<beach> I always use :SERIAL T, yes. My brain is too small to sort out the :DEPENDS-ON.
<dnhester90> "The error message specifically mentions a circular dependency for ASDF." I know, that's why I was stuck and didn't try to look into the package definitions so much based on the advice I found online...
<beach> What I am saying is that it can't possibly have anything to do with packages, because ASDF does not look at those.
<dnhester90> I would imagine it would be a great project to have a tool figure out compile order automatically and all the files and dependencies based on imports from defpackage, like it is in most languages, and at most exclude a file, or just point to the main file and not include anything not imported from the main start poing of the project...
<beach> There is such a thing already, but it imposes constraints that I can't live with.
<dnhester90> "What I am saying is that it can't possibly have anything to do with packages, because ASDF does not look at those." Ok, but that's what solved it. Removing a imports-from statement. So what can we say?
<beach> Package-inferred systems or something like that.
<dnhester90> What are the constraints or problems?
<beach> That a single file must contain all the code in a particular package, if I remember correctly.
<beach> Or that it doesn't have to be like that, but avoiding it is very complicated.
<beach> You don't need to quote me. My memory is not that bad (yet). I still remember what I uttered a few minutes ago.
<dnhester90> haha sorry, It's just that it's not always clear to which message I'm replying to. but ok, I'll refrain from doing so
karlosz has joined #commonlisp
<ogamita> Josh_2: https://termbin.com/7nvw
<ogamita> dnhester90: you may use com.informatimago.tools.check-asdf to help you find the circles in your dependencies.
<dnhester90> @ogamita thanks will check it out
<beach> ogamita: That won't help if it is the package definition (which I still don't believe it can be, of course).
<ixelp> GitHub - informatimago/lisp: Clone of https://gitlab.com/com-informatimago/com-informatimago Informatimago Common Lisp L [...]
<ogamita> Well, with package definitions, you get other kinds of errors in case of circularity.
<ogamita> beach: unless, can you put a package definition in the asdf:defsystem form as seen in the paste? I assumed it was botched.
<beach> Maybe so.
<dnhester90> Thanks for the tip guys, this looks like it can be useful in the future
<Nilby> I have in the past seen possibly bogus circular-dependency errors that seemed to go away on recompiling, which may have been due to be a mismatch between versions of Quicklisp and ASDF.
<ogamita> Nilby: this sounds more like it disappeared because you double-loaded the sources.
<ogamita> a depends on b depends on a ; load a, fail; load b, ok; load a, ok.
<ogamita> This is the behavior you'd see with circularities in defpackage forms.
Brucio-61 has quit [Ping timeout: 260 seconds]
<ogamita> notably, you can "build" those circularity when working in the image a long time, while loading successive versions. In the end, you only have the final versions of the files, and they have the circularity embedded so you cannot load them anymore from scratch.
<ogamita> load old-a ; load old-b ; load a ; load b -> when loading a, it can depend on the old-b, while old-a didn't. Next loading b it depends on a, and the circularity is established.
<Nilby> I understand that, but this was on a fresh image, and in cl-unicode, and went away when I got rid of old asdf versions.
<Nilby> Older debian and clisp have been know to supply quite old asdf.
rainthree3 has joined #commonlisp
rainthree has quit [Ping timeout: 240 seconds]
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
masinter_ has quit [Quit: ~ Trillian - www.trillian.im ~]
dnhester90 has quit [Ping timeout: 245 seconds]
dnhester26 has quit [Ping timeout: 265 seconds]
scymtym has joined #commonlisp
Brucio-61 has joined #commonlisp
johnjaye has quit [Ping timeout: 240 seconds]
johnjaye has joined #commonlisp
karlosz has quit [Quit: karlosz]
rogersm has quit [Quit: Leaving...]
random-nick has joined #commonlisp
NicknameJohn has quit [Ping timeout: 240 seconds]
notzmv has quit [Ping timeout: 265 seconds]
edgar-rft has quit [Remote host closed the connection]
pfd has joined #commonlisp
karlosz has joined #commonlisp
igemnace has quit [Remote host closed the connection]
bjorkint0sh has joined #commonlisp
bjorkintosh has quit [Ping timeout: 265 seconds]
prokhor has quit [Remote host closed the connection]
<phoe> Shinmera: aaaaaaa, someday
<phoe> I have no ability to do this at the moment
prokhor has joined #commonlisp
tyson2 has joined #commonlisp
igemnace has joined #commonlisp
pfd has quit [Ping timeout: 245 seconds]
amb007 has quit [Ping timeout: 268 seconds]
amb007 has joined #commonlisp
cage has joined #commonlisp
dnhester26 has joined #commonlisp
varjag has quit [Quit: ERC (IRC client for Emacs 27.1)]
dnhester has joined #commonlisp
Guest86 has joined #commonlisp
tevo has quit [Ping timeout: 240 seconds]
mgl has quit [Quit: Client closed]
notzmv has joined #commonlisp
Guest86 has quit [Quit: Client closed]
amb007 has quit [Ping timeout: 240 seconds]
gxt__ has quit [Ping timeout: 240 seconds]
parjanya- has quit [Ping timeout: 250 seconds]
kopiyka has quit [Remote host closed the connection]
gxt__ has joined #commonlisp
amb007 has joined #commonlisp
cage has quit [Remote host closed the connection]
amb007 has quit [Ping timeout: 240 seconds]
amb007 has joined #commonlisp
waleee has joined #commonlisp
amb007 has quit [Ping timeout: 268 seconds]
amb007 has joined #commonlisp
tevo has joined #commonlisp
amb007 has quit [Ping timeout: 240 seconds]
amb007 has joined #commonlisp
waleee has quit [Ping timeout: 265 seconds]
Gleefre has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
Cymew has quit [Ping timeout: 240 seconds]
NicknameJohn has joined #commonlisp
NicknameJohn has quit [Ping timeout: 250 seconds]
Gleefre has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Ping timeout: 240 seconds]
dnhester has quit [Ping timeout: 245 seconds]
mgl has joined #commonlisp
pranavats has left #commonlisp [Error from remote client]
<gilberth> I'm having a question about ~A. In 22.3.4.1 it says "If arg is a string, its characters will be output verbatim." <https://novaspec.org/cl/22_3_Formatted_Output#sec_22_3_4_1> However of the Lisp implementation that I have all but CLISP and ECL invoke *print-circle* processing with ~A, even when the argument is a string. I get <https://termbin.com/bv53>
<ixelp> 22.3 Formatted Output | Common Lisp Nova Spec
<gilberth> The question is: Is it me reading the spec in a too naïve way, or is it the Lisp implementations being buggy here. Perhaps just saying PRINC with ~A.
tibfulv has quit [Remote host closed the connection]
tibfulv has joined #commonlisp
roygbyte is now known as ROYGBYTE
<beach> Hard to say.
<splittist> Aren't the implementations differing in how (many times) PRINT-OBJECT is called, not in how ~A works?
alcor has quit [Remote host closed the connection]
<beach> Doesn't look that way since #<...> is output.
dnhester26 has joined #commonlisp
<gilberth> This issue concerns me a bit. For two reasons, at times I am not brave enough for FORMAT and punt like (format stream "~S is ~A integer." x (if signed "a signed" "an unsigned")) This breaks with *print-circle*. The other is: You often see idioms like (format nil "~{~A~^, ~}" strings) to join a list of strings by commas. The latter also would break.
ROYGBYTE is now known as roygbyte
<gilberth> splittist: The question is whether PRINT-OBJECT is invoked on ~A an argument at all, when that argument is a string.
<gilberth> That is whether pprint dispatch happens, whether *print-circle* processing happens. Or whether to take the spec verbatim and just invoke write-string with ~A when the argument is a string. Which is how I read that. But I'm not confident here, which is why I ask.
NicknameJohn has joined #commonlisp
<splittist> Ah - inside out rather than outside in.
<gilberth> And all those uses of FORMAT to craft strings from strings, e.g to generate some external representation would need to be wrapped around with-standard-io-syntax.
<gilberth> Let me put this question somewhat differently. Sould (format stream "~A" (the string x)) always be the same as (write-string (the string x) stream) or not?
<gilberth> Or should it rather be the same as (let ((*print-escape* nil) (*print-readably* nil)) (prin1 (the string x) stream)) ?
<scymtym> there seems to be a contradiction: ~A is supposed to output a string argument verbatim but ~S is supposed to be "just like ~A". i don't think both can be true since outputting strings verbatim prevents print-read consistency
msavoritias has quit [Ping timeout: 240 seconds]
<gilberth> I don't see the contraction.
<scymtym> ah, no. "print-read consistency" doesn't mean what i thought it meant
igemnace has quit [Remote host closed the connection]
<gilberth> Yep, it just says that what is output is suitable for READ.
<gilberth> Anyhow, I'm at a loss here. Do I fix my code or do I fix my Lisp implementation? Who's to blame?
<gilberth> I first came across this with (format nil "~{~A~^, ~}" strings), which given that I'm lazy, I use a lot. I needed to turn on *print-circle* and my code broke.
ec has quit [Ping timeout: 240 seconds]
ec has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
jmdaemon has joined #commonlisp
cage has joined #commonlisp
cosimone has joined #commonlisp
<gilberth> Here is another test, this time with ~:A printing NIL. Spec says "the colon modifier (~:A) will cause an arg of nil to be printed as ()". Doesn't happen either: https://termbin.com/y06j
bjorkint0sh has quit [Ping timeout: 248 seconds]
alcor has joined #commonlisp
bjorkintosh has joined #commonlisp
bjorkintosh has quit [Changing host]
bjorkintosh has joined #commonlisp
alcor has quit [Read error: Connection reset by peer]
alcor has joined #commonlisp
<gilberth> What about *print-pprint-dispatch* and ~A? <https://termbin.com/b2ds>
<gilberth> This is funny: <https://termbin.com/ro7kb> ;Note how SBCL special cases for (format nil "~a") and does not consult the pprint dispatch, while "~{~A~^, ~}" does. So someone, somewhen with SBCL share my interpretation. At least for some special case.
<yitzi> ~A is supposed to be like princ so it should use the dispatch table
edgar-rft has joined #commonlisp
<gilberth> Yet the spec says that when the argument is a string that string should be printed verbatim. It also says that when the colon is present, NIL should print as (). This doesn't happen.
<yitzi> I don't think that is contradiction. It is just "pre-processing" by FORMAT's directives.
Gleefre has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
<gilberth> It is. Not both claims "is printed with PRINC" and "If arg is a string, its characters will be output verbatim" can be true. Neither can the claim about NIL be true.
<gilberth> I read "An arg, any object, is printed without escape characters (as by princ). If arg is a string, its characters will be output verbatim." like "printed as with PRINC, but a string is printed verbatim." Likewise I read the following about ~:A printing NIL as () as an exception.
<gilberth> I don't read it like ~A is always like PRINC.
<yitzi> I agree
<gilberth> Good, then this is two of us. At least I am not the only idiot here. ;-)
cosimone has quit [Remote host closed the connection]
waleee has joined #commonlisp
cosimone has joined #commonlisp
<yitzi> After digging around in the plumbing of the printer a fair amount I have come to the conclusion that there are some odd things that were brought into the spec from the XP printers, and at the same time almost no details of the pretty printer were brought into the spec. For example, there is no statement about what is in the initial dispatch table. It is very underspecified, IMHO.
NotThatRPG has joined #commonlisp
<jackdaniel> format is the foremost overengineered construct in cl standard
<jackdaniel> loop comes second to it
<jackdaniel> funnily enough neither is partably extensible in a convenient way
<jackdaniel> (opinionated take™)
<NotThatRPG> Anyone out there using cl-async? I am facing some code that uses it and am lost. The code invokes `cl-asyn:start-event-loop` which, as far as I can tell, should return, but instead it hangs.
<gilberth> The pretty printer dispatch isn't what concerns me here too much. It's *print-circle* that concerns me. And the use of format to stich strings together by means of ~A. The assumption that (format nil "~{~A~}" strings) would be like (concatenate 'string strings) is true or false depending on how you read the ~A spec.
<NotThatRPG> I mean by "hangs" if I invoke it in the REPL, it never returns, not that it literally hangs.
<yitzi> jackdaniel: completely agree.
<jackdaniel> :)
rainthree3 has quit [Ping timeout: 250 seconds]
Krystof has quit [Ping timeout: 240 seconds]
<NotThatRPG> oh, I see: that code is just wrong. The event-loop won't terminate, and shouldn't.
<jackdaniel> bt:make-thread 'start-event-loop perhaps should do the trick
NotThatRPG has quit [Ping timeout: 240 seconds]
dcb has joined #commonlisp
NotThatRPG has joined #commonlisp
jeosol has joined #commonlisp
<jeosol> Good morning all!
<jeosol> Hope everyone is doing well!
<jeosol> Is anyone aware of a library to write to GCP bucket from CL side?
jmdaemon has quit [Ping timeout: 240 seconds]
attila_lendvai has quit [Ping timeout: 265 seconds]
mgl has quit [Quit: Client closed]
mathrick has quit [Remote host closed the connection]
mathrick has joined #commonlisp
Inline has joined #commonlisp
hineios has quit [Quit: Ping timeout (120 seconds)]
hineios has joined #commonlisp
tevo has quit [Ping timeout: 240 seconds]
tevo has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
jmdaemon has joined #commonlisp
cosimone has quit [Ping timeout: 240 seconds]
Inline has quit [Ping timeout: 268 seconds]
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
NotThatRPG has joined #commonlisp
<gilberth> It gets funnier. https://novaspec.org/cl/v_print-circle says "If a user-defined print-object method prints to a stream other than the one that was supplied, then circularity detection starts over for that stream." Doesn't happen with SBCL, CMUCL, or ABCL. <https://termbin.com/504d>
<ixelp> *print-circle* | Common Lisp Nova Spec
selfish has joined #commonlisp
tevo has quit [Ping timeout: 240 seconds]
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<yitzi> gilberth: I'd be surprised if any implementation does that. They all use a single group of dynamic variables to control it. If one implementation is different it could be CLISP. All the other implementations use either the original XP code or CMUCL's rewrite.
HamzaShahid has joined #commonlisp
<HamzaShahid> Hello Everyone!
<HamzaShahid> I wanted to create permutations of a list like (0 1 2) to ((0 1 2) (0 2 1) (1 0 2) (1 2 0) ...) lexecographically
<HamzaShahid> I came up with this recursive solution: https://termbin.com/nst4f
<HamzaShahid> Thing is... It kind of has a lot of annoying nested lists and all
<HamzaShahid> I am unable to make a function for that due to lack of skill
selfish has quit [Ping timeout: 265 seconds]
tevo has joined #commonlisp
NotThatRPG has joined #commonlisp
<gilberth> yitzi: Have you looked at the results that I got?
<yitzi> Sorry, I didn't see that you did CLISP also.
waleee has quit [Ping timeout: 248 seconds]
<gilberth> CCL, ECL, and ACL are fine too. It's CMUCL^WSBCL being lazy here.
johnjaye has quit [Ping timeout: 240 seconds]
<yitzi> I'm not sure about CCL, ECL and ACL. CLASP is based on ECL it doesn't attempt make circle detection stream specific.
johnjaye has joined #commonlisp
roygbyte is now known as ROYGBYTE
<gilberth> So with CMUCL^SBCL, ECL, ABCL circle printing also is ineffective when you print somewhere else. Again CCL, CLISP, ACL getting it right. IMHO.
xantoz has joined #commonlisp
xantoz has quit [Client Quit]
xantoz has joined #commonlisp
<pjb> HamzaShahid: it's the same code to create permutations of 2 values as for n values! Just modify my function (trivially).
<pjb> HamzaShahid: (defun all-symbol-combinations (p n) (if (zerop n) '(()) (let ((rests (all-bit-combinations (- n 1)))) (mapcan (lambda (bit) (mapcar (lambda (rest) (cons bit rest)) rests)) (iota p))))) (all-symbol-combinations 4 3) #| --> ((0 0 0) (0 0 1) (0 1 0) (0 1 1) (1 0 0) (1 0 1) (1 1 0) (1 1 1) (2 0 0) (2 0 1) (2 1 0) (2 1 1) (3 0 0) (3 0 1) (3 1 0) (3 1 1)) |#
<pjb> HamzaShahid: sorry, bad renaming; here it is: (defun all-symbol-combinations (p n) (if (zerop n) '(()) (let ((rests (all-symbol-combinations p (- n 1)))) (mapcan (lambda (bit) (mapcar (lambda (rest) (cons bit rest)) rests)) (iota p))))) (all-symbol-combinations 4 3) #| --> ((0 0 0) (0 0 1) (0 0 2) (0 0 3) (0 1 0) (0 1 1) (0 1 2) (0 1 3) (0 2 0) (0 2 1) (0 2 2) (0 2 3) (0 3 0) (0 3 1) (0 3 2) (0 3 3) (1 0 0) (1 0 1) (1 0 2) (1 0 3) (1 1
<pjb> 0) (1 1 1) (1 1 2) (1 1 3) (1 2 0) (1 2 1) (1 2 2) (1 2 3) (1 3 0) (1 3 1) (1 3 2) (1 3 3) (2 0 0) (2 0 1) (2 0 2) (2 0 3) (2 1 0) (2 1 1) (2 1 2) (2 1 3) (2 2 0) (2 2 1) (2 2 2) (2 2 3) (2 3 0) (2 3 1) (2 3 2) (2 3 3) (3 0 0) (3 0 1) (3 0 2) (3 0 3) (3 1 0) (3 1 1) (3 1 2) (3 1 3) (3 2 0) (3 2 1) (3 2 2) (3 2 3) (3 3 0) (3 3 1) (3 3 2) (3 3 3)) |#
<pjb> HamzaShahid: since it can grow fast, you may want to do it incrementally. have a look at: https://gitlab.com/com-informatimago/com-informatimago/-/blob/master/common-lisp/cesarum/combination.lisp
<ixelp> common-lisp/cesarum/combination.lisp · master · com-informatimago / com.informatimago · GitLab
jmdaemon has quit [Ping timeout: 240 seconds]
<jackdaniel> pjb: please don't paste code directly on the channel
Brucio-61 has quit [Ping timeout: 260 seconds]
Brucio-61 has joined #commonlisp
scymtym has quit [Ping timeout: 248 seconds]
notzmv has quit [Ping timeout: 250 seconds]
semz has quit [Quit: ZNC 1.8.2+deb2build5 - https://znc.in]
semz has joined #commonlisp
<HamzaShahid> pjb: Thanks! Let me test it out
Brucio-61 has quit [Ping timeout: 260 seconds]
cage has quit [Quit: rcirc on GNU Emacs 28.2]
waleee has joined #commonlisp
Brucio-61 has joined #commonlisp
<gilberth> So it looks like SBCL abandoms *print-circle* processing when doing output to another stream altogether, but for the top-level object printed to that other stream. I can see why they have chosen to do so. Watch <https://termbin.com/y6fs>. This time using ~S. When asking for ~20S however, CCL fails to do *print-circle* processing because it first prints the argument to a string.
Krystof has joined #commonlisp
<gilberth> However, completely abandoning *print-circle* may make you face some infinite recursion. I don't like that.
tevo has quit [Ping timeout: 265 seconds]
tevo has joined #commonlisp
attila_lendvai has joined #commonlisp
tyson2 has joined #commonlisp
waleee has quit [Remote host closed the connection]
waleee has joined #commonlisp
akoana has joined #commonlisp
attila_lendvai has quit [Ping timeout: 268 seconds]
mariari has quit [Read error: Connection reset by peer]
Oladon has joined #commonlisp
mariari has joined #commonlisp
waleee has quit [Ping timeout: 250 seconds]
waleee has joined #commonlisp
tyson2` has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
tyson2` has quit [Read error: Connection reset by peer]
waleee has quit [Ping timeout: 250 seconds]
waleee has joined #commonlisp
pve has quit [Quit: leaving]
karlosz has quit [Quit: karlosz]
alcor has quit [Remote host closed the connection]
akoana has quit [Quit: leaving]
waleee has quit [Ping timeout: 250 seconds]
ec has quit [Ping timeout: 240 seconds]
ec has joined #commonlisp
ec has quit [Ping timeout: 240 seconds]
ec has joined #commonlisp
waleee has joined #commonlisp
NicknameJohn has quit [Read error: Connection reset by peer]
ec has quit [Ping timeout: 240 seconds]
zephyr3 has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 250 seconds]
tychoish- has joined #commonlisp
Lord_of_Life_ has joined #commonlisp
viaken has quit [Ping timeout: 250 seconds]
jaimelm has quit [Ping timeout: 250 seconds]
mikko has quit [Ping timeout: 250 seconds]
tychoish has quit [Ping timeout: 250 seconds]
cross has quit [Ping timeout: 250 seconds]
zephyr3 is now known as zephyr
zephyr has quit [Ping timeout: 250 seconds]
tychoish- is now known as tychoish
jmdaemon has joined #commonlisp
Lord_of_Life_ is now known as Lord_of_Life
jaimelm has joined #commonlisp
cross has joined #commonlisp
shka has quit [Ping timeout: 240 seconds]
rgherdt has quit [Remote host closed the connection]
viaken has joined #commonlisp
mikko has joined #commonlisp
mikko has joined #commonlisp
Brucio-61 has quit [Remote host closed the connection]
Brucio-61 has joined #commonlisp
euandreh has joined #commonlisp
Oladon has quit [Quit: Leaving.]