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>
Lord_Nightmare has joined #commonlisp
taiju has quit [Ping timeout: 268 seconds]
charles_ has quit [Ping timeout: 252 seconds]
CrashTestDummy2 has joined #commonlisp
nature has joined #commonlisp
abrantesasf has joined #commonlisp
CrashTestDummy3 has quit [Ping timeout: 245 seconds]
<nature> Hi
<nature> I have a question regarding asdf, is there a way to make it download the dependencies when they are not present (with quicklisp I suppose)?
<nature> Like the scenario is that I am working on a project, I setup a new machine, clone the project, do I have to manually quickload all the dependencies again?
<White_Flame> if you quickload a project, it will automatically download the configured dependencies
waleee has quit [Ping timeout: 246 seconds]
<White_Flame> if you asdf load it, it doesn't
ec has quit [Ping timeout: 276 seconds]
<nature> When I try to quickload my project it says something like 'System "hunchentoot" not found'....
ec has joined #commonlisp
<nature> Never mind, something screwd up on the network for me
<nature> Thanks!
<Arcsech> Yeah Quicklisp doesn't have a great "hey you're not connected to the internet" error message
<hayley> It can't be any good without the dinosaur game.
waleee has joined #commonlisp
taiju has joined #commonlisp
srhm has quit [Read error: Connection reset by peer]
srhm has joined #commonlisp
CrashTestDummy3 has joined #commonlisp
CrashTestDummy2 has quit [Ping timeout: 245 seconds]
abrantesasf has quit [Remote host closed the connection]
Psybur has quit [Remote host closed the connection]
greaser|q has joined #commonlisp
greaser|q has quit [Changing host]
greaser|q is now known as GreaseMonkey
ec has quit [Ping timeout: 276 seconds]
recordgroovy has joined #commonlisp
ec has joined #commonlisp
patrice has joined #commonlisp
recordgroovy has quit [Quit: leaving]
abrantesasf has joined #commonlisp
abrantesasf has quit [Remote host closed the connection]
abrantesasf has joined #commonlisp
abrantesasf has quit [Remote host closed the connection]
abrantesasf has joined #commonlisp
wilfred has quit [Quit: Connection closed for inactivity]
leo_song has joined #commonlisp
ec has quit [Ping timeout: 276 seconds]
ec has joined #commonlisp
abrantesasf has quit [Remote host closed the connection]
attila_lendvai has quit [Ping timeout: 268 seconds]
ec has quit [Ping timeout: 276 seconds]
ec has joined #commonlisp
igemnace has quit [Remote host closed the connection]
ec has quit [Remote host closed the connection]
ec has joined #commonlisp
Josh_2 has quit [Quit: ERC (IRC client for Emacs 27.1)]
ec has quit [Ping timeout: 276 seconds]
ec has joined #commonlisp
prxq has quit [Ping timeout: 245 seconds]
prxq has joined #commonlisp
ec has quit [Ping timeout: 276 seconds]
CptKirk has joined #commonlisp
ldb has joined #commonlisp
<beach> Good morning everyone!
<ldb> hey
patrice has quit [Quit: Leaving]
jealousmonk has quit [Quit: ERC (IRC client for Emacs 27.1)]
akoana has quit [Quit: leaving]
Bike has quit [Quit: Lost terminal]
karlosz has joined #commonlisp
hendursaga has quit [Remote host closed the connection]
hendursaga has joined #commonlisp
waleee has quit [Ping timeout: 268 seconds]
semz has quit [Ping timeout: 252 seconds]
ec has joined #commonlisp
semz has joined #commonlisp
abrantesasf has joined #commonlisp
abrantesasf has left #commonlisp [#commonlisp]
abrantesasf has joined #commonlisp
lisp123 has joined #commonlisp
sm2n_ has quit [Read error: Connection reset by peer]
sm2n_ has joined #commonlisp
frgo has quit [Remote host closed the connection]
cjb54763 has joined #commonlisp
cjb54763 has quit [Client Quit]
cjb has quit [Ping timeout: 260 seconds]
ldb has quit [Ping timeout: 245 seconds]
ldb has joined #commonlisp
lisp123 has quit [Quit: Leaving...]
ldb has quit [Ping timeout: 250 seconds]
ldb has joined #commonlisp
ldb has quit [Ping timeout: 268 seconds]
ldb has joined #commonlisp
ldb has quit [Remote host closed the connection]
ldb has joined #commonlisp
abrantesasf has quit [Remote host closed the connection]
frgo has joined #commonlisp
<susam> beach: Good morning!
<susam> Good morning, everyone!
<hayley> Good morning susam!
frgo has quit [Ping timeout: 268 seconds]
<susam> hayley: Good afternoon! :)
<White_Flame> (dolist (nick (get-nicks "#commonlisp")) (greet nick (get-day-quadrant (local-time nick))))
pve has joined #commonlisp
Mandus_ has quit [Ping timeout: 250 seconds]
Mandus_ has joined #commonlisp
Mandus_ has quit [Ping timeout: 268 seconds]
Mandus_ has joined #commonlisp
notzmv has quit [Ping timeout: 240 seconds]
gaqwas has joined #commonlisp
Cymew has joined #commonlisp
Mandus_ has quit [Ping timeout: 245 seconds]
amb007 has quit [Ping timeout: 245 seconds]
amb007 has joined #commonlisp
karlosz has quit [Quit: karlosz]
Mandus_ has joined #commonlisp
ldb has quit [Quit: ERC (IRC client for Emacs 27.2)]
frgo has joined #commonlisp
srhm has quit [Read error: Connection reset by peer]
frgo has quit [Ping timeout: 252 seconds]
srhm has joined #commonlisp
CptKirk has quit [Ping timeout: 256 seconds]
amb007 has quit [Ping timeout: 245 seconds]
amb007 has joined #commonlisp
cosimone has joined #commonlisp
igemnace has joined #commonlisp
gaqwas has quit [Ping timeout: 252 seconds]
Mandus_ has joined #commonlisp
Mandus_ has quit [Ping timeout: 245 seconds]
jeosol has quit [Quit: Ping timeout (120 seconds)]
jkordani has quit [Ping timeout: 256 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
gin_ is now known as gin
gin has joined #commonlisp
gin has quit [Changing host]
rotateq has joined #commonlisp
<gin> why does (string< nil "123") return NIL but (string< nil "abc") return 0?
<_death> STRING< works on string designator.. NIL becomes the string "NIL"
amb007 has quit [Read error: Connection reset by peer]
<_death> (list (char< #\N #\1) (char< #\N #\a))
<gin> _death: thanks
<gin> is there an opposite of zerop? Like nonzerop? I know I can make one. But is there something already?
<gin> Or positive-integer-p?
<_death> there's plusp and minusp, but no nonzerop
<phoe> alexandria:positive-integer-p
<gin> _death: thanks
<phoe> in theory you could (complement #'zerop) to get an inverted predicate
<phoe> but in most cases it's easier to flip your logic from (when (zerop ...)) to (unless (zerop ...))
amb007 has joined #commonlisp
<gin> thanks
frgo has joined #commonlisp
<jackdaniel> ecl defines types like a positive-integer, positive-integer-p, non-negative-short-float and couple of others in the ext package per cdr-5 specification
<jackdaniel> https://common-lisp.net/project/cdr/document/5/index.html (sub-interval numerical types for common lisp)
<gin> is (when (first list) ...) a sane to test whether the list has at least one element? Or is it preferrable to use (when (not (zerop (length list))) ...)? Or something else is preferred?
<mfiano> Probably better to use emptyp
<mfiano> err
<jackdaniel> gin: (when (consp list) …)
<_death> (nil) has at least one element but your test will fail
<jackdaniel> if it is not empty, then it is a cons
<mfiano> alexandria:emptyp
<gin> thanks
<jackdaniel> calling (zerop (length list)) is not a good approach, because first you traverse whole list to compute its length
<jackdaniel> so for long lists you'll have n unnecessary steps
<mfiano> Well n-1 but yeah
<jackdaniel> there is a function (alexandria:length= 0 list) that when the first argument is integer has a compiler macro
<hajovonta> (null list)
<jackdaniel> hajovonta: 3 will return NIL, so the "list" is not null
<hajovonta> ok, but it's not a list
<jackdaniel> mfiano: n-1?
<hajovonta> also definitely not empty
frgo has quit [Ping timeout: 252 seconds]
<hajovonta> maybe (and (listp list) (null list))
<mfiano> Looks like alexandria has a compiler macro on emptyp, but my image is hosed right now and can't M-.
<mfiano> might want to look up what it does
<hajovonta> depending on what is needed
<mfiano> Seems like it would be readable if it optimizes that
<jackdaniel> hajovonta: and listp null is consp indeed ,)
<phoe> hajovonta: (and (listp list) (null list)) will also return NIL if LIST is 3
frgo has joined #commonlisp
attila_lendvai has joined #commonlisp
<phoe> but that's already the issue of why would someone pass a 3 to a function that accepts a list
<hajovonta> yea it's not a list
<phoe> and typechecking is kinda orthogonal to the original question
<phoe> (and kinda not)
dec0d3r_ has joined #commonlisp
dec0d3r has quit [Ping timeout: 250 seconds]
frgo has quit [Remote host closed the connection]
CrashTestDummy3 has quit [Quit: Leaving]
frgo has joined #commonlisp
frgo has quit [Ping timeout: 252 seconds]
hendursa1 has joined #commonlisp
JeromeLon has joined #commonlisp
hendursaga has quit [Ping timeout: 276 seconds]
selwyn has joined #commonlisp
Alfr has quit [*.net *.split]
Krystof has quit [*.net *.split]
andreyorst has quit [*.net *.split]
terrorjack has quit [*.net *.split]
borodust has quit [*.net *.split]
katya has quit [*.net *.split]
utis_ has quit [*.net *.split]
X-Scale has quit [*.net *.split]
mingus has quit [*.net *.split]
scymtym has quit [*.net *.split]
samebchase has quit [*.net *.split]
dec0d3r_ has quit [Remote host closed the connection]
frgo has joined #commonlisp
notzmv has joined #commonlisp
X-Scale has joined #commonlisp
frgo has quit [Ping timeout: 252 seconds]
Alfr has joined #commonlisp
andreyorst has joined #commonlisp
utis_ has joined #commonlisp
katya has joined #commonlisp
borodust has joined #commonlisp
samebchase has joined #commonlisp
Krystof has joined #commonlisp
mingus has joined #commonlisp
scymtym has joined #commonlisp
terrorjack has joined #commonlisp
CrashTestDummy has joined #commonlisp
dre has quit [Quit: Leaving]
frgo has joined #commonlisp
CrashTestDummy has quit [Read error: Connection reset by peer]
terrorjack has quit [Max SendQ exceeded]
terrorjack has joined #commonlisp
CrashTestDummy has joined #commonlisp
frgo has quit [Remote host closed the connection]
Everything has joined #commonlisp
selwyn has quit [Read error: Connection reset by peer]
taiju has quit [Ping timeout: 268 seconds]
taiju has joined #commonlisp
scymtym has quit [Ping timeout: 252 seconds]
taiju has quit [Ping timeout: 268 seconds]
taiju has joined #commonlisp
Mandus_ has quit [Ping timeout: 245 seconds]
Mandus_ has joined #commonlisp
random-nick has joined #commonlisp
loskutak has joined #commonlisp
abrantesasf has joined #commonlisp
scymtym has joined #commonlisp
hisacro has quit [Ping timeout: 264 seconds]
dec0d3r has joined #commonlisp
frgo has joined #commonlisp
random-nick has quit [Ping timeout: 246 seconds]
frgo has quit [Ping timeout: 250 seconds]
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #commonlisp
hisacro has joined #commonlisp
amb007 has quit [Ping timeout: 252 seconds]
amb007 has joined #commonlisp
selwyn has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
jealousmonk has joined #commonlisp
tyson2 has joined #commonlisp
abrante5 has joined #commonlisp
heisig has joined #commonlisp
abrantesasf has quit [Ping timeout: 264 seconds]
loskutak has quit [Ping timeout: 245 seconds]
loskutak has joined #commonlisp
abrante5 has quit [Read error: Connection reset by peer]
abrantesasf has joined #commonlisp
andreyorst has quit [Ping timeout: 252 seconds]
Mandus_ has quit [Ping timeout: 252 seconds]
amb007 has quit [Ping timeout: 245 seconds]
Mandus_ has joined #commonlisp
andreyorst has joined #commonlisp
makomo has joined #commonlisp
amb007 has joined #commonlisp
hisacro has quit [Ping timeout: 268 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
hisacro has joined #commonlisp
igemnace has quit [Remote host closed the connection]
igemnace has joined #commonlisp
scymtym has quit [Remote host closed the connection]
Inline has joined #commonlisp
kevingal has joined #commonlisp
Psybur has joined #commonlisp
Mandus_ has quit [Ping timeout: 252 seconds]
Bike has joined #commonlisp
Mandus_ has joined #commonlisp
rotateq has quit [Quit: ERC (IRC client for Emacs 26.3)]
Mandus_ has quit [Ping timeout: 252 seconds]
Mandus_ has joined #commonlisp
waleee has joined #commonlisp
ec has quit [Ping timeout: 276 seconds]
ec has joined #commonlisp
Josh_2 has joined #commonlisp
igemnace has quit [Quit: WeeChat 3.2.1]
igemnace has joined #commonlisp
cosimone has quit [Read error: Connection reset by peer]
Everything has quit [Ping timeout: 245 seconds]
scymtym has joined #commonlisp
Mandus_ has quit [Ping timeout: 264 seconds]
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
makomo has quit [Ping timeout: 252 seconds]
Mandus_ has joined #commonlisp
makomo has joined #commonlisp
heisig has quit [Quit: Leaving]
pjb is now known as Guest8892
Guest8892 has quit [Ping timeout: 246 seconds]
pjb has joined #commonlisp
azimut_ has quit [Remote host closed the connection]
azimut has joined #commonlisp
bwestbro has quit [Remote host closed the connection]
Mandus_ has quit [Ping timeout: 250 seconds]
bwestbro has joined #commonlisp
Mandus_ has joined #commonlisp
mortemeur has joined #commonlisp
Jach has quit [Remote host closed the connection]
abrantesasf has quit [Ping timeout: 252 seconds]
Everything has joined #commonlisp
Jach has joined #commonlisp
abrante19 has joined #commonlisp
abrante19 has quit [Read error: Connection reset by peer]
abrantesasf has joined #commonlisp
Inline has quit [Ping timeout: 246 seconds]
<gin> what is the SLIME command to see the list of workers/threads? one of my infinite loop code is running and I want to kill that
<Alfr> gin, slime-list-threads may help.
<gin> Alfr: thanks
abrante49 has joined #commonlisp
abrantesasf has quit [Ping timeout: 252 seconds]
CptKirk has joined #commonlisp
makomo has quit [Ping timeout: 250 seconds]
NeoCron has joined #commonlisp
Inline has joined #commonlisp
ec has quit [Quit: ec]
hisacro has quit [Ping timeout: 245 seconds]
hisacro has joined #commonlisp
<gin> I want to test if a string is non-empty. is this the simplest test: (string/= s "") ? is there another idiomatic test?
<beach> (zerop (length string))
<beach> Or, rather (plusp (length string))
abrante49 has quit [Read error: Connection reset by peer]
<gin> beach: thanks
abrantesasf has joined #commonlisp
<beach> Sure.
dec0d3r has quit [Remote host closed the connection]
ec has joined #commonlisp
aeth has quit [Ping timeout: 246 seconds]
aeth has joined #commonlisp
frgo has joined #commonlisp
hisacro has quit [Ping timeout: 252 seconds]
hisacro has joined #commonlisp
tyson2 has joined #commonlisp
makomo has joined #commonlisp
Catie has joined #commonlisp
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
dra has joined #commonlisp
Cymew has quit [Ping timeout: 245 seconds]
makomo_ has joined #commonlisp
Mandus_ has quit [Ping timeout: 252 seconds]
hisacro has quit [Ping timeout: 245 seconds]
selwyn has quit [Read error: Connection reset by peer]
hisacro has joined #commonlisp
Mandus_ has joined #commonlisp
tyson2 has joined #commonlisp
jkordani has joined #commonlisp
amb007 has quit [Ping timeout: 250 seconds]
amb007 has joined #commonlisp
raeda__ has quit [Quit: Leaving]
hendursa1 has quit [Remote host closed the connection]
hendursa1 has joined #commonlisp
cage has joined #commonlisp
amb007 has quit [Ping timeout: 245 seconds]
amb007 has joined #commonlisp
CptKirk has quit [Ping timeout: 256 seconds]
dra has quit [Quit: Leaving]
hisacro has quit [Ping timeout: 268 seconds]
<copec> Has anyone made a reader macro for latex math symbols, that transform it into a unicode
* copec thinks on that
<copec> I suppose what I really want is something in the editor (emacs)
mortemeur has quit [Ping timeout: 252 seconds]
selwyn has joined #commonlisp
<hexology> copec: i'm pretty sure there's an emacs thing for that
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
igemnace has quit [Ping timeout: 245 seconds]
lisp123 has joined #commonlisp
amb007 has joined #commonlisp
random-nick has joined #commonlisp
<lisp123> copec: Would this help? https://github.com/ashok-khanna/math-hydras
<pjb> copec: in the editor it's trivial and probably already exist.
<pjb> copec: you may also just want to display them differently. I have pretty-greek: https://github.com/informatimago/emacs/blob/master/pjb-sources.el#L735
<pjb> you can use keyboard translations if you want to insert the unicode, or abbrev to "expand" a char name to the unicode itself.
aeth has quit [Ping timeout: 250 seconds]
Inline has quit [Ping timeout: 252 seconds]
aeth has joined #commonlisp
hisacro has joined #commonlisp
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #commonlisp
<akater[m]> I just have my own shortcuts. I type ⇒ ⇒ ⊗ → ↦ often enough to have them summoned by two-char labels.
<akater[m]> Some LaTeX commands are just way too long to be practical.
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
<jkordani> Last time I tried Latex directly in emacs I had to shell out to a program to convert them to pdf and open that in emacs. I was surprised there wasn't direct rendering into a buffer
<jkordani> or maybe I missed that
<lisp123> jkordani: There is for maths
<lisp123> But honestly I'm not a huge fan of latex within Emacs, so yeah I didn't really set it up
<copec> I used latex for a long time, so I have it all memorized
<copec> Is there a standard for international symbol names within an English Alphabet I wonder?
<copec> So a pinyin type input could become standardized
<jkordani> actually that was exactly what I was looking for
<jkordani> thank you!
<lisp123> :)
<pjb> but abbrev only works on words, not on special characters :-(
tfeb has joined #commonlisp
<copec> math hydras looks like what I need
<copec> I was looking at this too https://github.com/kawabata/math-symbols
<lisp123> Yeah I saw that one too
<dieggsy> If I wanted to keep a directory of external CL libraries in my project source tree, could I use quicklisp to manage that ?
<dieggsy> ideally i'd just want a simple project-directory/dep-diretory/ library-source directory structure
srhm has quit [Read error: Connection reset by peer]
<Catie> I've seen something like that as a build option for Nyxt
<Catie> They depend on Quicklisp libraries, and you can either have them managed in the Nyxt source tree or in your local Quicklisp base directory
<Catie> I'm not sure if that's the sort of thing you're looking for though
<dieggsy> Mostly I'd want them only in our source tree, but with the option to update them using quicklisp i guess
<jkordani> dieggsy: are you taking these dependencies from quicklisp or all they all non-quicklisp projects
<Catie> Could you bind QL:*QUICKLISP-HOME* within your project?
<dieggsy> I believe they're all available in quicklisp
srhm has joined #commonlisp
<jkordani> you could use quicklisp-quickbundle to export them, then use the resulting bundle.lisp file and load that
tyson2 has joined #commonlisp
<jkordani> you might need to modify the resulting bundle if you want to include your own libraries
<jkordani> and I think that should be as simple as providing the path to it, or the asd file
<dieggsy> Well, I guess the situation is this - we already have a directory of dependencies, and I'm looking for the easiest way to update those libraries. If quicklisp let me download the sources of a particular library to an arbitrary location, that'd be nice
<dieggsy> I suppose I could put quicklisp home under the project root, but I don't actually want to track anything other than the sources of the libs themselves
srhm has quit [Read error: Connection reset by peer]
<dieggsy> Might be worth just doing manually given the frequency at which we update things (almost never) lol
<etimmons> ql:bundle-systems (assuming that's what you're referring to) can also miss dependencies of package inferred systems.
srhm has joined #commonlisp
<etimmons> dieggsy: why do you want to do this? I feel like you're just making it harder on yourself to update your deps.
<dieggsy> eric: We are already tracking our deps in our project, that part's not really in my control. i'm just looking for a better way to actually update them, without having to propose removing the sources from the project tree
<etimmons> Plus it would encourage folks to modify the sources of your deps directly (making both updates and getting improvements upstreamed harder)
<dieggsy> See above i guess. Nobody touches the dep sources though. And they haven't been updated in years. Which in most cases is fine, but i'm looking for a better way to do that should it be necessary
<etimmons> Ooph, I'm sorry. When I first started working on my group's code base it also had dep sources just copy pasted in. Was a nightmare.
gaqwas has joined #commonlisp
<dieggsy> ...I guess I could just have a script that copy pastes from wherever quicklisp is installed. That feels pretty messy. ay ay ay.
<Alfr> dieggsy, if your deps use git and your project does that too, try gitsubmodules.
<dieggsy> Hey, that or subtrees might not be a terrible idea
tfeb has quit [Quit: died]
<dieggsy> ...assuming they do all use git
molson__ is now known as molson
cage has quit [Quit: rcirc on GNU Emacs 27.1]
Inline has joined #commonlisp
jeosol has joined #commonlisp
<copec> I have the dependency in the asdf definitions, and pre-populate the quicklisp cache
<copec> not that I have anything other than amateur projects
<dieggsy> copec: do you keep the quicklisp cache in the source tree?
<copec> No, but I suppose I could
<copec> That actually brings up a question I've had. I don't really distribute anything, what do people use to build their programs (ie from a shell)?
<copec> make(1)?
<pve> copec: I usually do it with a lisp script
<Fade> I tend to bundle a make file for my systems.
<dieggsy> copec: at work we just use asdf + extra lisp addons and then save an image, but there is makefile that I think just calls that lisp. at home i've experimented with roswell but mostly just lisp scripts
<Fade> nyxt just calls out to asdf in a Makefile
<etimmons> dieggsy: I feel like the problem is a little underspecified still. When you decide to perform your hypothetical update, do you want all of your deps to be upgraded? A single direct dep? A single direct dep and all of its direct deps?
<Fade> pgloader has an interesting build process.
<etimmons> If you upgrade all deps at once, that's easier but is more likely to break things, especially if you haven't done an upgrade in forever
<copec> I've never dug into more, can you specify package versions like a python venv?
<copec> If I specified versions, I would probably feel the need to replicate the specific versions for the deps
<copec> nothing I do is that important though, I can see someone wanting a project where something is always buildable though
<etimmons> copec: I use CL scripts (ASDF pretty much does everything make(1) does that I'd be interested in)
<dieggsy> eric: yeah, it's been 5+ years since we've updated most of these, so i'm hesitant to update at all lol. I'd think i'd want to update a single direct dep + all of its deps at a time though
<Fade> dieggsy: that's an epic in your code base.
<Fade> depending, I guess, on the size of the code base.
<copec> Since image based, does there exist systems to stepwise inspect and upgrade an existing image?
<etimmons> copec: versioning in CL is a mess. You can specify system versions and version constraints on your dependencies using ASDF. But most dependency management solutions (like QL) ignore those. I'm trying to improve that situation with CLPM, but it is slow going
<copec> out of curiosity for a clusterfsk
<copec> I keep meaning to jump into CLPM
<dieggsy> Fade: an epic?
<Fade> a long story
<Fade> much time and effort
<Fade> sorry, agile drain bammage leaking into the real world.
<dieggsy> Fade: Oh, it's a very large and very very old code base so, yeah. it's kind of a backburner "maybe at some point we should look into this, but CL is stable enough and it may be more hassle than it's worth" thing
<dieggsy> mostly i'm concerned about whether there's been any important security updates to these libraries since they were last updated
<greyrat> When working via SLIME, one major problem I have is that most variables are bound via `let` or function arguments. So I can't eval small chunks of code one at a time. How do you overcome this issue? (Julia has a macro that can export all local variables to the globl scope for this purpose. Is such a macro possible in commonlisp?)
<Bike> such a macro is probably not possible, but i don't think i understand the problem you describe. could you maybe give a little example of the workflow here?
<Fade> if I was on that teaam, I guess I'd start with anything using cffi.
<etimmons> dieggsy: That might be difficult to ascertain at a glance. There are some CL projects that maintain changelogs, but I think that's more the exception than the rule.
<dieggsy> eric: hm, that's unfortunate. appreciate the insight though
<White_Flame> greyrat: printing has always been the most flexible means of debugging
<etimmons> A fairly complex program of mine has 100 deps and I count 17 with changelogs
<White_Flame> I usually have a macro like (debug x) which prints "X = <val of X>", also taking multiple variable names/expressions
<copec> Can you inspect objects with slime and your implementation greyrat?
<White_Flame> however, if you insert breakpoints, you can use sldb to inspect the local variable state, but you'd need to ensure that your debug optimization is set pretty high
<White_Flame> printing just ends up being quick, easy, and comprehensive, with the lingering downside of being swamped in too much info, but that can still be sifted through
<copec> Bike, I'm trying to think of the interactions that could take place from within the image to using dtrace on it :-P
<greyrat> Bike: say we have a let* that defines a lot of variables. I want to eval some code using these vars. But the vars are not global, so the only way to do this is to run the whole let* block.
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
pranavats has joined #commonlisp
<greyrat> White_Flame: I also like printing and have a similar printer macro, but printing is not a very good solution for experimenting.
<Bike> hm. well, i guess you could make them global with defparameter or whatnot. maybe you could actually make that into a macro. i don't think i usually need to do stuff like that with more than like three to five bindings, in which case it's pretty easy to just use globals to begin with, i guess
<greyrat> Bike: Yes, I can usually get away with using globals, but globals make the code less refactorable for future use.
<White_Flame> greyrat: hmm, I think it aligns with experimentation pretty well, as both experimentation and adding/removing print output both touch the code anyway
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
<Bike> i thought you said you used globals in julia
<greyrat> Bike: I used a macro that automatically exported local vars as globals, so my code was still sound. In CL, I write bad code that uses globals from the start.
<Bike> how does using globals affect the code? i mean, you still write like, (foo bar) and temporarily have bar be a global variable, and then later it's lexical but the "(foo bar)" code is the same
<pve> greyrat: is there a problem with running the whole let block?
<greyrat> Hmm. Can you give an actual example? Say we have (let ((a "a")) ...). How do you export `a' as global?
<Bike> (defparameter a "a")
<Bike> normally you're supposed to do *a* but that's just a convention, and doing otherwise temporarily isn't a big issue
<greyrat> pve: The biggest problem is that only the last expression of the block is returned, so I would need add additional glue code.
<greyrat> Bike: I do not want to repeat the value of `a' when exporting it globally.
<greyrat> Sth like `(let ((a "a")) (export-me 'a) ...)` would be best.
tyson2 has joined #commonlisp
<Bike> oh, you mean like within the let block. (let ((a "a")) (defparameter a a)) probably works
<greyrat> let me test that
<Bike> failing that, (setf (symbol-value 'a) a), assuming a isn't locally special
<pve> greyrat: I also never considered it a problem, but could you make (debug-let ((a "a") ...) ... ) that does what you need?
<pve> i.e. defparameter all the bindings
<greyrat> pve: exactly. That's what I want.
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
<greyrat> defparameter worked btw.
<pve> possibly with a suitable naming convention like %*A* or %A or just straight A
<Alfr> If it's for debugging, maybe progv and read-eval-print? But other lexical stuff won't be there.
pranavats has joined #commonlisp
<pve> greyrat: are you asking how to make debug-let?
<greyrat> defparameter only worked once; After that, `a' was special I guess, and so it no longer worked?
<greyrat> setf worked well though.
<greyrat> pve: I guess I will take a crack at it myself first. I think I will be able to manage, though I am new to CL.
<pve> greyrat: ah, ok hang on a second
<greyrat> How do I declare `a' as not special? (basically undoing the defparamter)
<Alfr> greyrat, you can't.
<greyrat> Alfr: I did not understand what you mean. `progv''s docs are rather vague.
<pve> greyrat: maybe something like this?
<pjb> greyrat: (unintern 'a) and create a new symbol.
<Alfr> pjb, that changes the symbol.
<pjb> greyrat: this is why it should not be a, but *A* !!!
<pjb> Alfr: indeed.
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
<pve> greyrat: whoops, fixed a mistake :)
<pve> please reload if you checking out that macro
<greyrat>
<greyrat> pve: is `(format nil "%~A" name)` correct?
<greyrat> (The `%` seems to be extra?)
<pve> greyrat: no it's on purpose
<greyrat> Well it gives me `The variable %A12 is unbound.`
<greyrat> When I use:
<greyrat> (letd ((a12 "MiNA"))
<greyrat> (concat a12))
<greyrat> I changed the collect line to ``(setf (symbol-value ,(intern (format nil "%~A" name))) ,symbol)`, if it matters.
<pve> oh do you need let*?
<Alfr> greyrat, progv establishes dynamic bindings valid for the duration of its body. So to get what you asked for, my idea is to introduce something like (debug-vars (foo bar ...) body) which then transforms to (progv '(foo bar ..) (list . (foo bar ..)) (print (eval `(locally (declare special ,@(foo bar ..)) ,(read))))).
<greyrat> pve: usually, I prefer let*.
<Alfr> greyrat, ^ likely isn't valid, but I think you get the idea.
<pve> greyrat: well I didn't test it a whole lot, but it does work here
<pve> it lets me eval %a etc in the repl
<pve> greyrat: try macroexpanding to see what you get
<Alfr> greyrat, also forget about that body part, as we're reading the thing to evaluate anyway.
<pve> greyrat: it interns into *package* if that matters
<pve> greyrat: oh btw you a quote in that change you made
<pve> ',(intern ...
scymtym_ has joined #commonlisp
<greyrat> pve: Yeah, that was exactly what was stumping me!
<pve> should've kept the defparameter :)
<greyrat> pve: So this worked for me:
<greyrat> (defmacro letd (bindings &body body)
<greyrat> ,@(loop :for b :in bindings
<greyrat> `(let ,bindings
<greyrat> :for symbol = (if (consp b)
<greyrat> (first b)
<greyrat> b)
<greyrat> :for name = (symbol-name symbol)
<pve> please don't paste here
<greyrat> :collect `(setf (symbol-value ',(intern (format nil "~A" name))) ,symbol))
<greyrat> ,@body))
scymtym has quit [Ping timeout: 268 seconds]
<greyrat> Mistakenly thought pressing RET on emacs paste prompt will use a pastebin.
<greyrat> It defaulted to not using one. :face-palms:
hisacro has quit [Ping timeout: 250 seconds]
<pjb> pve: don't use ~A to generate symbol name, without controling other variables such as *print-case* !!!
<pjb> (loop for *print-case* in '(:upcase :downcase :capitalize) collect (intern (format nil "%~A" 'foo))) #| --> (%foo |%foo| |%Foo|) |#
<pve> pjb: thanks, I guessed it properly done :)
<pve> wasn't properly done
<pjb> use concatenate or symbol-name.
<pjb> or both.
scymtym_ has quit [Ping timeout: 246 seconds]
<pve> pjb: hm wait, I gave a string to format.. does it matter?
<greyrat> pjb: I dropped the format completely: `(setf (symbol-value ',(intern name)) ,symbol)
<greyrat> BTW, what does this `%` do?
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
<greyrat> I also don't understand how `setf` bypassed the lexical scope and set the variable globally. Does `setf` always work in the global scope?
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
pranavats has joined #commonlisp
<pve> greyrat: perhaps *%foo* would have been better
abrantesasf has quit [Ping timeout: 250 seconds]
<greyrat> Oh, it's just a naming convention you adopted. It's not necessary for the code to function, right?
lottaquestions has quit [Ping timeout: 260 seconds]
CptKirk has joined #commonlisp
abrante95 has joined #commonlisp
<pve> greyrat: I don't know for a fact that you won't run into strange behaviour if your temp variables collide with your "normal" ones, which is why I put the prefix
<lisp123> How often do you guys use q to record macros?
<lisp123> (sorry wrong chat - plz ignore)
hisacro has joined #commonlisp
<pve> like will (setf x 1) make x a special variable? I'm not sure..
cosimone has joined #commonlisp
<pve> no I mean (setf (symbol-value 'x) 1)
<greyrat> Hmm
<pve> because unless I'm mistaken, you might inadvertently refer to x somewhere else, and not get a "undefined variable" warning
<greyrat> Oh, that's kind of unavoidable; x will be exported globally.
<pve> which could lead to a debugging nightmare
<White_Flame> greyrat: the compiler determines at compile-time what setf is storing into. If it's declared special at that time, it compiles a special var setf. else it compiles a local one
<greyrat> pve: I will condition the macro on *repl-p*, so that it won't export the vars if we are not in a repl.
<White_Flame> (assuming a symbol/variable name)
<greyrat> I can use a global var in the macro definition, can't I?
<pve> greyrat: anyway, that's why I used the %
<greyrat> (BTW, I manually set *repl-p* to t when I am in a REPL.)
<pjb> greyrat: a string to ~A is ok.
<greyrat> White_Flame: I am confused; `setf` is setting a global variablein `(let ((b "sth")) (setf (symbol-value 'b) b))`, where `b` is not special.
<pjb> greyrat: the symbol-value of a symbol is global.
<White_Flame> yeah, and also that's not setting a global variable. That's setting a slot on a symbol object
ec has quit [Quit: ec]
<pjb> greyrat: that gives you access to the dynamic binding of a special variable named by this symbol.
<Bike> white_flame was talking about what (setf x b) does, i.e. where the place being set is a variable name
Skyfire has quit [Quit: WeeChat 3.3]
Skyfire has joined #commonlisp
<pjb> (progn (setf (symbol-value 'foo) 42) (locally (declare (special foo)) foo)) #| --> 42 |#
<pjb> (progn (setf (symbol-value 'foo) 42) (locally (declare (special foo)) (setf foo 33)) (symbol-value 'foo)) #| --> 33 |#
<greyrat> Hmm. I guess all global variables are special?
<White_Flame> the term "global" isn't often used
<pjb> pve: you could also intern your symbols in your one of own packages, or a temporary package.
<White_Flame> for instance, SBCL has a defglobal, which creates a variable that cannot have any dynamic LET bindings, only its singular value
<pve> pjb: sure, probably safest that way
<pjb> greyrat: not necessarily. If you mean defvar/defparameter variables yes. But there are also constant variables (defconstant), that are not special, no dynamic binding (but also it doesn't matter, because we cannot bind locally constant variables. But there is also global symbol-macros that can be used to define global lexical variables. symbol macros are lexical.
<pjb> pve: anyways, once there's a %, it also indicate that it's a private symbol and you need to know what you're doing to use it. So %foo or *%foo* or %*foo* don't make much difference.
scymtym has joined #commonlisp
<pve> pjb: right, it's not everyday I consider private special variables
abrante95 has quit [Read error: Connection reset by peer]
<White_Flame> there also used to be global lexical variables, and all sorts of other weird names
abrantesasf has joined #commonlisp
tyson2 has joined #commonlisp
<greyrat> I found how to write this exflitration macro in Clojure at least: https://paste.gnugen.ch/paste/22Md . Now I have it in Python, Julia, and Clojure. And this CL's `letd` is close enough. ^_^
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
shka has quit [Ping timeout: 245 seconds]
elderK has joined #commonlisp
pve has quit [Quit: leaving]
gaqwas has quit [Ping timeout: 252 seconds]
contrapunctus has left #commonlisp [#commonlisp]
NeoCron has quit [Quit: Leaving]
_abrantesasf_ has joined #commonlisp
_abrantesasf_ has quit [Remote host closed the connection]
<dim> Fade: are you referring to pgloader's `make pgloader` target or the newer `make save` target which is written in Common Lisp?
abrantesasf has quit [Quit: -a- IRC for Android 2.1.59]
abrantesasf has joined #commonlisp
notzmv has quit [Ping timeout: 252 seconds]
hajovont` has joined #commonlisp
hajovonta has quit [Read error: Connection reset by peer]
Spawns_Carpeting has quit [Quit: ZNC 1.7.2+deb3 - https://znc.in]
attila_lendvai has quit [Ping timeout: 252 seconds]
dec0d3r has joined #commonlisp
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
loskutak has quit [Ping timeout: 246 seconds]
zazzerino has joined #commonlisp
cosimone has quit [Ping timeout: 252 seconds]
Krystof has quit [Ping timeout: 252 seconds]
dre has joined #commonlisp
contrapunctus has joined #commonlisp
contrapunctus has left #commonlisp [#commonlisp]
contrapunctus has joined #commonlisp
igemnace has joined #commonlisp
Inline has quit [Ping timeout: 246 seconds]
kevingal has quit [Remote host closed the connection]
selwyn has quit [Read error: Connection reset by peer]
<dieggsy> greyrat: letd?
scymtym has quit [Remote host closed the connection]