Xach 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>
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
dnaeon has quit [Ping timeout: 245 seconds]
aeth has quit [Ping timeout: 248 seconds]
aeth has joined #commonlisp
Spawns_Carpeting has quit [Ping timeout: 240 seconds]
Spawns_Carpetin- has joined #commonlisp
makomo has quit [Ping timeout: 250 seconds]
Spawns_Carpetin- has quit [Ping timeout: 250 seconds]
Spawns_Carpeting has joined #commonlisp
igemnace has joined #commonlisp
Lycurgus has quit [Quit: Exeunt]
<mfiano> Is a separate asd file recommended for auxiliary systems such as unit tests, or placed in the same asd file. I know that asdf will warn you that secondary systems in the same file must be the name of the file with a / appended to it, but I was just wondering if anyone has any good reasons for putting secondary systems in the same file as opposed to a separate one.
<mfiano> ? after first sentence :)
tyson2 has quit [Remote host closed the connection]
Alfr has quit [Remote host closed the connection]
Alfr has joined #commonlisp
akoana has left #commonlisp [Leaving]
<pjb> Josh_2: it's possible.
<pjb> mfiano: yes, I would recommend one asdf system per asd file, with the file name being the name of the system suffixed with .asd
ahc has joined #commonlisp
<pjb> mfiano: by the way, there are warning issued now when you put multiple systems in a single asd file.
<pjb> Josh_2: you would write a macro that would collect the function name, and expand to a form that would make them available at run-time.
<Josh_2> pjb: so with something like this I am able to use asdf make to save my lisp image, and then on resumption I could execute all the functions defined with your define-fun using call-funs?
lucerne has quit [Ping timeout: 245 seconds]
lucerne has joined #commonlisp
azimut has joined #commonlisp
azimut_ has quit [Quit: ZNC - https://znc.in]
<rdrg109> TIL StumpWM is a windows manager in Common Lisp
dtman34 has quit [Ping timeout: 240 seconds]
dtman34 has joined #commonlisp
prxq_ has quit [Ping timeout: 252 seconds]
prxq has joined #commonlisp
<beach> Good morning everyone!
dtman34 has quit [Ping timeout: 268 seconds]
notzmv has joined #commonlisp
dtman34 has joined #commonlisp
semz has quit [Ping timeout: 250 seconds]
raeda has quit [Quit: Leaving]
semz has joined #commonlisp
ryanbw has joined #commonlisp
jeosol has quit [Ping timeout: 248 seconds]
dtman34 has quit [Ping timeout: 248 seconds]
dtman34 has joined #commonlisp
dtman34 has quit [Ping timeout: 252 seconds]
Bike has quit [Quit: Lost terminal]
taiju has quit [Ping timeout: 250 seconds]
jeosol has joined #commonlisp
dtman34 has joined #commonlisp
<lotuseater> Good morning to you again beach :)
<beach> lotuseater: What does your nick refer to? I mean, I know that lotus seeds are edible, and I have had some in the past.
<lotuseater> I had this idea last year, cause I thought on a new nick name that fits to me too.
<lotuseater> It refers to a radio speech by David Hilbert from 1930.
<beach> Oh!
<lotuseater> There he quotes Kronecker, who once compared the number theorists to the lotophagues from Greek mothology.
<beach> Hmm. I see.
<lotuseater> And as I see myself partly in that field with my heart I thought this could be good. :)
<lotuseater> The quote goes like "... and when they once ate a piece of it they never can let go from it."
<beach> Yes, I understand.
<lotuseater> It was one year before Gödel contracted Hilbert's vision of "We can prove or disprove everything."
<lotuseater> From where your nick origins I got once when you told me. :) Funny word play.
<lotuseater> But please don't ask me about algebraic number theory. ^^
<beach> I won't.
<lotuseater> But I'm sure it will happen over and over again that I ask dumb CL questions.
<kakuhen> lotuseater: hey I have a question about Gal(Q) ;)
<lotuseater> kakuhen: No, I don't know anything of this.
<lotuseater> I'm interested in things like "Concrete Mathematics" by Don Knuth offers. Still much to learn. So sorry, I will quit now being offtopic. :)
<kakuhen> im more interested in "mathematics," if that makes sense; unfortunately, it's hard to get computers to do symbolic computation, but maybe it's easier in common lisp? I'll find out eventually
<kakuhen> Several weeks ago I rewrote a naive implementation of xorshiro256 in common lisp, with the end-goal being to be able to randomly generate floats with uniform distribution over R
<kakuhen> Doing this because I can't trust RANDOM across implementations >.<
<lotuseater> Mathematics is a very generic term.
<lotuseater> kakuhen: Oh yes, I liked the capabilities for that from the beginning of my journey.
<lotuseater> But when doing symbolic mathematics with the computer I learned or better realized how ambigous mathematical notation is in traditional notation, so it's important staying consistent to catch everything.
etiago has quit [Quit: ZNC 1.8.2 - https://znc.in]
<lotuseater> or how unclear algorithms in math books or papers with pseudo code can be specified
<kakuhen> eh, I've never understood complaints about mathematical notation, but that's an issue to be discussed elsewhere, not here.
<kakuhen> anyway, I'm trying to find a good paste site so I can share my RNG code and have some people here criticize how i write lisp
<kakuhen> the usual site I use destroys the indentation, unfortunately.
<kakuhen> oh, too late w
etiago has joined #commonlisp
<lotuseater> ah you use iterate. i heard it's good for when one wants extensibility
<kakuhen> there's a funny reason I first starting using iterate
<kakuhen> the way one of my friends used LOOP made me never want to do anything with it, because the syntax annoyed me greatly
<lotuseater> I could try sometime writing a Mersenne Twister.
<kakuhen> so I decided to try importing iterate into this software, and I really liked it, and so did he
<kakuhen> then in the future I asked "should we really be mixing loop and iterate all over the place? or stick with just one?"
<kakuhen> we went with the latter option
<lotuseater> great if it fits your needs. i saw in the gitlab repo it's literally one file
<kakuhen> eventually I replaced all LOOP code with ITERATE; and the convention in this software is, quite literally, "Don't loop, iterate!" (the title of the paper it was introduced in!)
<lotuseater> I remember one of the first talks by beach I saw was the one about LOOP from 2014.
<lotuseater> In PAIP there's a chapter on how to implement parts of LOOP. so it's for you to decide how to build the DSL syntax
<lotuseater> in XOSHIRO256+ you could define a closure for doing this (mod ... mask)
<beach> Ah, yes, one of my first SICL-related papers.
<lotuseater> or maybe also define local symbol-macros like state[1] for (aref state 1)
<beach> 2016 it seems.
<lotuseater> Oh okay I just tried to remember.
<lotuseater> right, the ELS talk on YT has timestamp May 30, 2016
<lotuseater> kakuhen: and the trick I learned 2 weeks ago, when setf-ing on symbol-macros a SETQ is enough, it's a special rule
<beach> kakuhen: You should have three semicolons on top-level comments.
<lotuseater> Some of the SICL papers I downloaded but not yet read all.
<beach> clhs 2.4.4.2
<specbot> Notes about Style for Semicolon: http://www.lispworks.com/reference/HyperSpec/Body/02_ddb.htm
<beach> kakuhen: And line 22 violates the rule that is stated on page 13 of the LUV slides by Norvig and Pitman.
[deleted] has joined #commonlisp
<beach> kakuhen: Same thing with line 25.
<lotuseater> I should look that up myself again.
<lotuseater> beach: You know that by heart, right? ^^
<beach> The page number? Of course.
<lotuseater> but I'm not sure how to reconstruct that piece
<lotuseater> or (assert (and nums ...)) ?
<lotuseater> ah no
<beach> You mean how to make it conform to the LUV slides?
<lotuseater> yes
<beach> (unless (null nums) ... to start with.
<lotuseater> ah so the intention gets clear, right?
<beach> Yes.
<beach> And (if (null nums) (iter ...) nums)
<lotuseater> Like you once advised me with (zerop x) vs (= x 0)
<beach> That's a different rule though. It's the one that says to use the most specific construct that will have the desired effect.
<lotuseater> Okay I'll remember that when I run into that myself next time or see it at some point of my code.
<beach> ... as in (1+ ...) rather than (+ ... 1)
<lotuseater> right
<lotuseater> (+ 0 (* 1 (expt (sqrt (1+ (1- x))) 2)))
<beach> Heh.
<beach> Could be the expansion of a macro call.
<lotuseater> right, so then compiler macros could help out
<beach> No need. The compiler is smart enough to simplify that form.
<lotuseater> Okay, I trust it. :)
<lotuseater> I mean the compiler, I trust you of course with no doubt.
<beach> kakuhen: And I would break the documentation string for MAKE-RNG-STATE into 2 or more lines.
elderK has quit [Quit: Connection closed for inactivity]
<lotuseater> kakuhen: and you could use #+ for also supporting 32bit :)
<lotuseater> So how was this rule of thumb, about up to length 100 lines?
<beach> I try not to go above 80, but it's a soft limit. It depends on how many pixels you have on your screen(s) and how many documents you can comfortably display side by side.
<lotuseater> Or having a wide screen monitor.
<lotuseater> But all in all the code looks good.
<kakuhen> beach lotuseater: thanks for the feedback! I'm currently reading it as I type this
<kakuhen> regarding character limits, I was told to apply it for code but not necessarily for docstrings
<kakuhen> is this a good practice?
<kakuhen> (fwiw, this is the convention I apply in the code I posted)
<lotuseater> no that should go for docstrings the same
<lotuseater> you could use #.(format nil "...~NEWLINE...~NEWLINE...")
<kakuhen> oh good idea; I should learn how to do that
frgo has quit [Remote host closed the connection]
livoreno has joined #commonlisp
notzmv has quit [Ping timeout: 252 seconds]
[deleted] has quit [Ping timeout: 250 seconds]
domovod has joined #commonlisp
gaqwas has joined #commonlisp
selwyn has joined #commonlisp
notzmv has joined #commonlisp
pve has joined #commonlisp
scymtym has quit [Ping timeout: 268 seconds]
asarch has joined #commonlisp
dnaeon has joined #commonlisp
dnaeon has quit [Changing host]
dnaeon has joined #commonlisp
asarch has quit [Client Quit]
frgo has joined #commonlisp
dnaeon has quit [Quit: EOF]
rgherdt has joined #commonlisp
shka has joined #commonlisp
frgo has quit [Remote host closed the connection]
cage has joined #commonlisp
hendursa1 has joined #commonlisp
hendursaga has quit [Ping timeout: 244 seconds]
domovod_ has joined #commonlisp
domovod has quit [Ping timeout: 252 seconds]
rain3 has joined #commonlisp
cosimone has joined #commonlisp
taiju has joined #commonlisp
pve has quit [Ping timeout: 252 seconds]
<lisp123> May be useful to some of you
frgo has joined #commonlisp
amb007 has quit [Ping timeout: 240 seconds]
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
frgo has quit [Remote host closed the connection]
scymtym has joined #commonlisp
<pjb> lisp123: so we already had 3 CLON libraries doing the same (using the same fucking name!). Now they add other libraries to do the same with smartass names…
notzmv has quit [Read error: Connection reset by peer]
<kakuhen> At least it isn't "unit testing framework no. ω" ;)
makomo has joined #commonlisp
<pjb> kakuhen: :-)
domovod_ has quit [Quit: WeeChat 3.2]
<lisp123> pjb: Heh, I didn't know that
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
taiju has quit [Ping timeout: 240 seconds]
amb007 has quit [Ping timeout: 248 seconds]
amb007 has joined #commonlisp
<pjb> lisp123: when we still had cll, you could read up the backlock, and get the whole history of CL… But nowadays, it's more difficult. You have a multitude of sources to check, irc, web sites, who knows where…
taiju has joined #commonlisp
selwyn has quit [Read error: Connection reset by peer]
amb007 has quit [Read error: Connection reset by peer]
<lisp123> pjb: Yeah I wish we had a functional CLL instead of all these sources
<lisp123> But we live in the world we live in
amb007 has joined #commonlisp
kakuhen has quit [Quit: Leaving...]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
selwyn has joined #commonlisp
frgo has joined #commonlisp
amb007 has quit [Ping timeout: 250 seconds]
amb007 has joined #commonlisp
lisp123_ has joined #commonlisp
lisp123 has quit [Ping timeout: 250 seconds]
selwyn has quit [Read error: Connection reset by peer]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
frgo has quit [Remote host closed the connection]
nij- has joined #commonlisp
<nij-> Is there a way to write a macro to abstract line 131~150 in https://github.com/sharplispers/clawk/blob/master/clawk.lisp#L131 ? I encountered similar problem a few days ago.
amb007 has quit [Ping timeout: 268 seconds]
<nij-> So the final goal will produce those 20 lines by (loop for i from 1 to 20 do (goal i))
<nij-> Even better, from 130~221 we can do similar things.
amb007 has joined #commonlisp
igemnace has quit [Quit: WeeChat 3.2]
<nij-> Or maybe it's not.. the tricky part is to snatch a character with the number.
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
frgo has joined #commonlisp
random-nick has joined #commonlisp
frgo has quit [Ping timeout: 240 seconds]
<lisp123_> I assume this is not possible, but is there a way to specialise a generic method on a -list- of a particular object? (I assume no, so I would need to specialise on list and then check for the object-type)
<beach> nij-: You may have to use EVAL.
<beach> lisp123_: Correct.
<lisp123_> beach: Thanks!
<jeosol> good morning everyone
<beach> Hello jeosol.
<jeosol> beach: hope you are well
<beach> Very well thank you. You too?
<jeosol> Yes, doing ok. Still making my foray going over algorithms again - just finished graph and graph processing algorithms and its application in software module packaging, compilation
<jeosol> This is something I am interested in to speed up my compilation but I have to come to it much later on
<beach> Wow, ambitious.
<jeosol> Oh no, I didn't mean I am implementing that --- no no
<jeosol> I am not a compiler person at all, my goal is in the application side
<jeosol> of things
<beach> Even just reading up on it.
<jeosol> Oh I see what you mean
<jeosol> I was trying to get better deeper understanding of these graph algorithms and eventually pick a related CL one
<jeosol> to work with and extend if possible
<beach> Sounds good.
<jeosol> I did a section on symbol tables search algorithms (trees, BSTs, red-black BST's, and hashing). I wanted to ask the type of methology to resolve collisions that you use in SICL or used in CL: linear probing or separate chaining that uses linked lists in the array indices
<nij-> beach, gotcha :) lemme try
nij- has quit [Quit: Using Circe, the loveliest of all IRC clients]
<jeosol> I assume the latter since its more space efficient
<jeosol> beach: symbol tables above is not the same as in CL parlance, but much like key-value symbol tables for search
<beach> jeosol: In hash tables? I think hayley implemented several versions, and they are all in the SICL repository.
<hayley> A hash table? SICL has both linear probing and linked list buckets.
<beach> That's what I thought. Thank you.
<hayley> The former (with a SIMD-within-a-register partial hash search trick) is a bit faster.
<jeosol> hayley: thanks for that. There are benefits with the linear probing one so good to have both
<jeosol> very interesting
<hayley> And I believe the former is more space efficient too, as linked list buckets "waste" space to CDRs, and the partial hashes let us drive up the load factor somewhat.
<beach> jeosol: For search trees, you may want to look into splay trees. They are simpler to implement than red-black trees, and they are self-caching.
<jeosol> beach: and self balancing too to keep the height reasonable ~ h ~ log(n)
<jeosol> I guess it's trying to get some guarantee on growth rates.
<beach> Right.
<jeosol> beach: thanks, I will take a look at splay trees
<beach> I use splay trees for the lines of a standard Cluffer buffer. It's a perfect fit.
<beach> Editors tend to exhibit spatial locality, and splay trees can keep several regions close to the root.
<jeosol> beach, haylay: It may be too much work at this time, did you do some benchmark - not sure it's necessary at this time, but I believe the codes are optimized as much as possible
tyson2 has joined #commonlisp
<hayley> I should have a graph of hash table performance somewhere...
<jeosol> beach: that's better is many regions are not too far from root. Will take a look at cluffer
<beach> jeosol: For hash tables? Not me! hayley is in charge.
<jeosol> beach: ok noted
<hayley> https://applied-langua.ge/~hayley/sicl-hash-tables.png Note all are swamped by SBCL generic function overhead - I wrote them in a SICL style.
<jeosol> better if many regions ...
<jeosol> hayley: thanks for the link. I guess bucket hashtable is the one that uses the linked-list when indices collide
<hayley> I don't have a graph with DEFSTRUCT on SBCL, but from memory you can mentally subtract 50ns or so.
<jeosol> hayley: very nice work. thanks for the graphs
<hayley> Sure.
<jeosol> haylay: so I am clear, what is "list hashtable" in the graphs
<jeosol> as in the underlying data structure used for the implementation?
<hayley> It is a "hash table" implemented using an alist, yes.
<hayley> The names correspond to class names in SICL. And, yes, the bucket hash table is the one that uses linked lists.
<mfiano> beach: You may want to look into partial splay trees, which are often a better choice.
<beach> mfiano: Never heard of them. I'll check it out. Thanks.
<mfiano> Let me find the paper
cosimone has quit [Ping timeout: 250 seconds]
<mfiano> beach: I _think_ this was the one I read: https://eapache.github.io/assets/Huus2014_SplayTrees.pdf
<beach> Thank you!
<beach> Looks like *the* paper to read for a summary of improvements to the original design.
<jeosol> haylay: thanks for clarifying that
<mfiano> Yeah I'm just noticing that. I don't know if this was the paper I read now...
<mfiano> But still probably decent to read
<beach> Yeah.
perrierjouet has joined #commonlisp
<beach> I'll search for partial splay trees myself.
<hayley> The paper mentions "partway" splaying, which I guess could be read as "partial" if one reads too quickly. But if mfiano says he couldn't find what he was thinking of, I suppose that is not the case.
perrierjouet has quit [Client Quit]
<mfiano> the original partial splaying scheme introduction
<mfiano> THat could be it
<mfiano> Yes that was it
<beach> Perfect!
perrierjouet has joined #commonlisp
<mfiano> mfiano couldn't find what he was looking for because his eyes are barely open yet
<beach> mfiano: Aren't you supposed to be off on vacation?
<mfiano> We have a tropical storm with thunderstorms all weekend, so we are doing something else today only, while staying home
<beach> Oh, wow. The same one that hit Haiti?
<mfiano> Yes
<beach> I see.
pranavats has left #commonlisp [#commonlisp]
frgo has joined #commonlisp
Lycurgus has joined #commonlisp
frgo has quit [Ping timeout: 250 seconds]
notzmv has joined #commonlisp
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #commonlisp
<pjb> beach: actually nij- should write a reader macro for $ to read $42 and $NF, not generate a ton of symbol-macros. What if the regexp has one more group?
<beach> Makes sense. I didn't look very deep into the problem to be solved.
cosimone has joined #commonlisp
santiagopim has quit [Ping timeout: 250 seconds]
Bike has joined #commonlisp
Bike has quit [Quit: Connection closed]
Bike has joined #commonlisp
lonjil has quit [Quit: Quit.]
lonjil has joined #commonlisp
amb007 has quit [Ping timeout: 252 seconds]
amb007 has joined #commonlisp
kulernil has joined #commonlisp
paulman has quit [Ping timeout: 244 seconds]
pranavats has joined #commonlisp
frgo has joined #commonlisp
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
waleee has joined #commonlisp
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
Lycurgus has quit [Quit: Exeunt]
kulernil has quit [Remote host closed the connection]
kulernil has joined #commonlisp
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
frgo_ has joined #commonlisp
frgo_ has quit [Remote host closed the connection]
amb007 has quit [Read error: Connection reset by peer]
frgo_ has joined #commonlisp
amb007 has joined #commonlisp
shka has quit [Quit: Konversation terminated!]
frgo has quit [Ping timeout: 250 seconds]
frgo_ has quit [Remote host closed the connection]
frgo has joined #commonlisp
shka has joined #commonlisp
notzmv has quit [Ping timeout: 252 seconds]
lisp123 has joined #commonlisp
lisp123_ has quit [Ping timeout: 250 seconds]
Lord_of_Life has quit [Quit: Laa shay'a waqi'un moutlaq bale kouloun moumkine]
Skyfire has quit [Remote host closed the connection]
Skyfire has joined #commonlisp
Lord_of_Life has joined #commonlisp
azimut_ has joined #commonlisp
azimut has quit [Ping timeout: 244 seconds]
tyson2 has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 252 seconds]
Bike has quit [Quit: Connection closed]
amb007 has quit [Ping timeout: 240 seconds]
amb007 has joined #commonlisp
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
raeda has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
skami has joined #commonlisp
<skami> Hello ! I'm trying to have a slynk repl that has access to the context I'm running it in. For instance by doing something like, https://pastebin.com/2eVBedr2, id like to be able to access 'var' and 'i'
Lord_of_Life has joined #commonlisp
Bike has joined #commonlisp
<pjb> skami: there's no standard way to get access to that lexical context. If some implementation gives you access to it, then you can use its specific API. Otherwise, you will have to implement your own analyser (or use eg. that of sicl), to build the information and data structures you need in the editor.
yitzi has joined #commonlisp
sjl has joined #commonlisp
Fade has quit [Ping timeout: 252 seconds]
<pjb> skami: note that "getting access to var and i" is something that is lexically determined. You cannot get access to them outside of the form. When your cursoris just before (loop, you would have access only to var, not to i.
Fade has joined #commonlisp
<pjb> skami: also, note the syntax of loop is: loop [name-clause] {variable-clause}* {main-clause}* => result* ; and initially is a main-clause while for is a variable-clause. So 1- you should move initially after for, and 2- you have lexical access to i in the initially form.
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
<pjb> skami: but this can only be determined after macroexpanding the macros! You could hard code it form CL macros and CL special operators, and also it might be difficult to rely on the implementation-provided macros since their expansions can be "suprising", but for user defined macros, you'll have to expand them.
<pjb> skami: this means that you will need to be able to evaluate user code (those eval-when :compile-toplevel functions defined by the user to be used in the macro bodies…
<pjb> skami: again, you could get some help from sicl.
<pjb> skami: what I'm saying is that you need to implement basically your own compiler.
<Josh_2> When using nginx as a reverse proxy have any of you had unexpected behaviour with urls? Seems that nginx is decoding !! at the end of my urls, urls that I have encoded with do-urlencode
<pjb> skami: note that you are allowed to use macroexpand "in the editor", even if the user macros have side effects and are not idempotent: it's the job of the user to write their macros so that doesn't pose any problem.
<pjb> skami: but this also mean that you could get errors and other problems, that you should protect yourself against. perhaps you could have a look at clpm and how they use separate processes to avoid that kind of problem (in the case of clpm, to avoid problems with different versions for dependencies).
<pjb> skami: ie. you might want to fork your own CL implementation to perform the loading, compiling, macroexpansion, and environment extraction, instead of doing it the user image where he's working. On the other hand, this poses the problem of the *features* (if it's a different CL implementation), and of the set of libraries loaded that may be needed (in a specific version) by the user macros.
<pjb> skami: again, perhaps sicl could help, with the work beach did on 1st class environments.
<pjb> skami: of course, you can also try to do a half-assed job using heuristics…
<pjb> skami: for example, you could just check whether there's a symbol var in some surrounding sexp, in some special place (ie a binding position).
<pjb> skami: even if that's not the meaning of the code, or if some macro could hide or give a different meaning. It'd work only have the time as any half-assed job that respect itself should do.
paulman has joined #commonlisp
<skami> pjb: Thanks a lot ! sicl's environments look very interesting.
kulernil has quit [Ping timeout: 244 seconds]
<skami> Some hack where I use macros to catch the lexical bindings i'm interested in and rebind them in the repl might be a quick way to do that
amb007 has quit [Ping timeout: 252 seconds]
amb007 has joined #commonlisp
^[ has quit [Quit: ^[]
tyson2 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
Bike has quit [Quit: Connection closed]
amb007 has quit [Ping timeout: 268 seconds]
amb007 has joined #commonlisp
cosimone` has joined #commonlisp
cosimone` has quit [Remote host closed the connection]
cosimone has quit [Ping timeout: 250 seconds]
cosimone` has joined #commonlisp
cosimone` has quit [Remote host closed the connection]
cosimone has joined #commonlisp
attila_lendvai has joined #commonlisp
z147 has joined #commonlisp
attila_lendvai has quit [Quit: Leaving]
cosimone has quit [Ping timeout: 268 seconds]
<lisp123> I am trying to add some useful logging for recursive functions (doing it myself, no logging libraries, I don't they really add much)
<lisp123> For now, I am just using (progn (logging expression) (main expression)) --> Is there really any better way?
<lisp123> I couldn't find a way to keep the logging in a separate function, since it needs access to the lexical variables
* edgar-rft goes into the woods for logging some trees
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
<lisp123> If there is a bug in a forest and no one is around to see it, does it a program crash?
<edgar-rft> I've heard there live many bugs in the forests :-)
<edgar-rft> but it's right, many of them hide under the bark, so they cannot be seen
<lisp123> it's a bugs life
<edgar-rft> maybe we should ask bugs bunny
<lotuseater> wonderful pixar film
<lisp123> Amazing
<lisp123> I saw it in '3D' at Disney World, technology was amazing back then (this would have been 2002)
<lotuseater> oh wow
<jcowan> pjb: In such a compiler image, you could replace *features* with the one for the target environment.
Lord_of_Life has quit [Remote host closed the connection]
rain3 has quit [Ping timeout: 250 seconds]
Lord_of_Life has joined #commonlisp
cosimone has joined #commonlisp
<pjb> jcowan: but what if a function is called, or a symbol interned according to those wrong features?
<jcowan> CL compilers aren't exactly built to do cross-compilation.
<jcowan> ecl excepted
<pjb> and sicl.
Lord_of_Life has quit [Read error: Connection reset by peer]
Lord_of_Life has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 27.1]
ramenbytes has joined #commonlisp
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 252 seconds]
<shka> i suspect that you could also try cross compilation with clasp
Lord_of_Life_ is now known as Lord_of_Life
<shka> and get good result
notzmv has joined #commonlisp
ramenbytes has left #commonlisp [ ]
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
xlei has quit [Read error: Connection reset by peer]
Krystof has joined #commonlisp
Bike has joined #commonlisp
tyson2 has joined #commonlisp
xlei has joined #commonlisp
<Josh_2> lisp123: if you want access to the lexical variables then you could use a closure
<lisp123> Josh_2: I would still need to pass that data to a logging function if its outside of the main function, correct?
<Josh_2> sure, you could just pass the variables
<Josh_2> ofcourse I have no clue what your system is like
<lisp123> Yeah, that's the problem (not that its a big problem)
<lisp123> I am stuck with lines within the main function thats doing the logging (either directly or calling a logging function)
<lisp123> So if I want to turn off logging, I am still stuck with traces of logging code in the functions
<lisp123> I was hoping to do something independent, with some global switches to turn logging on and off, but I'm stuck with passing the lexical data to the logging functions
<lisp123> CLOS :before & :after don't have access to it, and :around processes the primary method at the end (unless there are some sort of hacks around method combinations)
<lisp123> I wonder if a Macro could help
<Josh_2> can you show the code?
<Josh_2> yes there are hacks in method combinations, you can make your own!
<lisp123> Code is too messy and convoluted (400 lines)
<lisp123> Let me whip up an example
<Josh_2> alrighty
<lisp123> So I want to have access to all bindings within a function, and then call the logging function after the function returns (or just before it does, shouldn't matter too much)
<lisp123> I say all the bindings, because I want something very general that I can use across any function that I want to log
<lisp123> But I want to remove the line within the main function that calls the logging function, and control logging on/off by some other switch
<lisp123> Only solution I can really think of is creating a macro, which makes the variables dynamic, and then inserting the logging function at the end
<lisp123> (Alternatively, I could put everything in a macro and not have a defun within the macro, but then I can't funcall / apply on the main function)
<Josh_2> what is wrong with just sending the values of a and b?
<lisp123> Josh_2: its fine, just messy. That's what I am doing now
<Josh_2> oh I see
<lisp123> I guess its not too bad
<Josh_2> well if you want to make it more generic you could use a rest and your logger could just loop over the values printing both the symbol and the value
<Josh_2> and you can just disable logging in the logger with a global variable
<Josh_2> also I know thats just example code but let* exists to let you reference other variables bound within the let form
<lisp123> Yeah I just did that to drive the point I need all the values, not just in one let
<Josh_2> alrighty
<lisp123> I'm trying to parse your earlier comment
<lisp123> How would it work?
<Josh_2> Yeh I was wrong. But still you could do something like (defun generic-logger (stream &rest args) (format stream "~{~A~%~}" args)) (let ((a 1) (b 2)) (generic-logger t `(a ,a) `(b ,b)))
clemens3 has joined #commonlisp
<Josh_2> Tbf you could write your own version of let that composed the generic-logger form automatically
<lisp123> Thats a pretty good idea
<lisp123> it could capture any variable defined in the let
<lisp123> and log it
<Josh_2> Yes I think thats the best bet, and you can just make a call out to a function where you can disable/enable with a special var or a global var
<lisp123> I think so, that would be quite helpful. At least get default logging on all let variables, and the rest just deal with - doesn't solve everything, but from a quality of life perspective, not bad at all
<lisp123> Thanks Josh_2!
scymtym has quit [Ping timeout: 250 seconds]
sjl has quit [Quit: WeeChat 2.2-dev]
shka has quit [Ping timeout: 250 seconds]
<Josh_2> I did it
akoana has joined #commonlisp
akoana_ has joined #commonlisp
<Josh_2> https://plaster.tymoon.eu/view/2603#2603 look at that if you want the macro, dont if you want to figure it out yourself
akoana__ has joined #commonlisp
<lisp123> I will try it first, I'm very bad at macros so need all the practice I can get
<Josh_2> Good stuff
paulman has quit [Ping timeout: 244 seconds]
IPmonger has joined #commonlisp
IPmonger has quit [Remote host closed the connection]
<pjb> lisp123: if you're unsatisfied with CLOS standard method combinations (primary around before after), then just define your own! define-method-combination is there fore you!
<Josh_2> Or you can use the non standard methods like progn, +, append etc
<Josh_2> I find append very useful
<pjb> lisp123: perhaps you would just want to use cl-stepper?
<lisp123> pjb: I am using cl-stepper in certain places, esp for debugging. This is more for data problems, so what I am doing is logging the entire process, and then extracting into a special format (e.g. xml) to quickly jump between parts
<lisp123> cl-stepper is great, thanks for sharing :)
amb007 has quit [Read error: Connection reset by peer]
z147_ has joined #commonlisp
amb007 has joined #commonlisp
<pjb> lisp123: you can see all the bindings there ;-)
<lisp123> its _very_ useful :)
z147_ has quit [Client Quit]
z147 has quit [Ping timeout: 244 seconds]
amb007 has quit [Ping timeout: 250 seconds]
amb007 has joined #commonlisp
akoana has quit [Quit: leaving]
akoana__ has quit [Quit: leaving]
akoana_ has quit [Quit: leaving]
akoana has joined #commonlisp
sjl has joined #commonlisp
derelict has quit [Quit: WeeChat 3.2]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
taiju has quit [Ping timeout: 250 seconds]
cosimone` has joined #commonlisp
cosimone has quit [Read error: Connection reset by peer]
Alfr has quit [Killed (tungsten.libera.chat (Nickname regained by services))]
Alfr has joined #commonlisp
cosimone` has quit [Ping timeout: 268 seconds]
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 252 seconds]
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
lisp123 has joined #commonlisp
Lycurgus has joined #commonlisp
derelict has joined #commonlisp
yitzi has quit [Quit: Leaving]
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
taiju has joined #commonlisp
derelict has quit [Quit: WeeChat 3.2]
lisp123 has quit [Ping timeout: 240 seconds]
Bike has quit [Quit: Connection closed]
makomo has quit [Ping timeout: 250 seconds]
Bike has joined #commonlisp
Alfr has quit [Remote host closed the connection]
Alfr has joined #commonlisp
Alfr has quit [Remote host closed the connection]
Lycurgus has quit [Quit: Exeunt]
Alfr has joined #commonlisp
akoana has quit [Read error: Connection reset by peer]
rgherdt has quit [Ping timeout: 250 seconds]
Alfr has quit [Ping timeout: 252 seconds]
xlei has quit [Quit: ZNC - https://znc.in]
kakuhen has joined #commonlisp
lisp123 has joined #commonlisp
derelict has joined #commonlisp
xlei has joined #commonlisp
livoreno has quit [Read error: Connection reset by peer]
livoreno has joined #commonlisp
Alfr has joined #commonlisp
Guest94 has joined #commonlisp
livoreno has quit [Read error: Connection reset by peer]
[deleted] has joined #commonlisp
[deleted] has quit [Read error: Connection reset by peer]
livoreno has joined #commonlisp
lisp123 has quit [Ping timeout: 248 seconds]
Guest94 has quit [Client Quit]
[deleted] has joined #commonlisp
livoreno has quit [Read error: Connection reset by peer]
[deleted] has quit [Read error: Connection reset by peer]
livoreno has joined #commonlisp
Qwnavery has joined #commonlisp
livoreno has quit [Read error: Connection reset by peer]
livoreno has joined #commonlisp
livoreno has quit [Read error: Connection reset by peer]
livoreno has joined #commonlisp
livoreno has quit [Read error: Connection reset by peer]
livoreno has joined #commonlisp
<akater[m]> A macroexpansion `(prog1 (defclass a ..) (defmethod ..) ..)` triggers style-warnings “Cannot find type for specializer A when executing …” (at least with SBCL). If I evaluate the first form and a progn of the rest forms separately, style-warnings are not there. How do I write a macroexpansion that would not trigger style-warnings?
livoreno has quit [Read error: Connection reset by peer]
[deleted] has joined #commonlisp
Qwnavery has quit [Quit: WeeChat 3.2]
gaqwas has quit [Ping timeout: 250 seconds]
<lotuseater> hm setting all in a PROGN instead of PROG1 ?