IRC channel logs
2026-05-14.log
back to list of logs
<TheTaoOfSu>I'm getting ready to start my first Lisp project in Guile, and while I've heard about how Lisp programs can be interactively/iteratively debugged and modified on the fly, I haven't been able to find concrete info on how that works. Maybe I just skimmed the Guile manual too hard and missed it, but kinda feels like most of the info I'm finding assumes just a little more Lisp experience than I have, at <TheTaoOfSu>least in that regard. Can anyone point me towards info on that? <TheTaoOfSu>I have Emacs with a couple plugins installed, namely Geiser and ParEdit, and I... Think it might be mainly by using the connection to an external REPL? Maybe start the app there and the make that connection to do what needs doing? <fantazo>TheTaoOfSu: what do you mean? it works by loading files or typing stuff into the REPL right away. <TheTaoOfSu>I dunno, I'm not really familiar with the workflow, so my understanding probably isn't as solid as it could be. Maybe I'm overcomplicating it <TheTaoOfSu>So I guess just compile them into the REPL and issue commands there as neede? I see Geiser has some extra commands for stuff like recompiling the file you're focused on <identity>TheTaoOfSu: you do not «compile them into the REPL». there is no meaningful «compile» step that you have to make as a user <identity>it gets compiled, yes, but you are not invoking a compiler yourself <TheTaoOfSu>Ah, okay, I guess I'm just getting things a bit mixed up. I'm looking at the Geiser cheat sheet and seeing commands like geiser-compile-current-buffer <identity>in a way, the program is alive and you can poke at it and reconfigure it while it is going <TheTaoOfSu>Yeah, I loosely get how things work with the REPL, but I guess that just felt a bit too... simple and obvious or something, I dunno. Sounds like I'm just overcomplicating it, then <identity>‘geiser-compile-current-buffer’ is mostly just «evaluate it, and also make it run fast(er)» afaik <dsmith>TheTaoOfSu, Common Lisp has the kinds of things you are asking about. Not Guile and not usually Scheme. <dsmith>TheTaoOfSu, Where you add code at the repl, compile it, and then save the process image. Guile does not do that. <identity>dsmith: but Guile does allow you to debug and modify programs on-the-fly, which is what TheTaoOfSu is asking about <dthompson>yes, you can debug and modify programs on the fly with geiser <TheTaoOfSu>I did learn a little about CL before deciding I'd rather work with Guile, so maybe that's what's throwing me off <dthompson>with geiser you can enter expressions into the REPL prompt, (re)evaluate individual top-level forms within a module file, or (re)evaluate entire modules <dsmith>identity, Oh absolutely. You just have to save your code in a source file somewhere eventually. <dsmith>Typically, you write the code, and send it to guile with C-x C-e or something <identity>you do not have to, you can just forget to do that <rlb>If anyone's more familiar with the better ways to use "conditions", I was wondering about adding an errno condition so that both our system-exceptions and the relevant rnrs conditions could use it (in the compound condition) to carry the actual value. Right now rnrs conditions just drop errno. This would be, in particular, for cases where multiple errno values produce the same condition type. <JohnCowan>rlb: you have to be careful to capture errno early because you are only allowed to look at it immediately after the Posix function call that failed. In particular it is not set to 0 on success. <rlb>Right, though in these cases, guile has already done that. <rlb>i.e. *we* have the right errno value, and we use it to decide what kind of exception to build, but we don't include it in the exception anywhere, so you can investigate finer distinctions if you want/need ti. <ArneBab>TheTaoOfSu: adjusting procedures in a game while you’re playing it is just awesome. ,m (game module) (define (fun-name ...) ... new code ...) ⇒ adjust behavior on the fly until it looks good. <JohnCowan>rlb: okay, but you should be sure to exclude itfrom any compound condition if there is in fact no Posix error rather a than returning junk <rlb>Oh, right, thanks --- we only fold that in there when we do have an error. <rlb>The vague idea would be that we'd always fold one of those in when there's a relevant errno, bot for our existing system-errors (whenever they're being converted to conditions), and for (relevant) rnrs conditions. <rlb>And then you can get the errno via that (exception-errno ex) accessor if exception-with-errno?. <dsmith>rlb, Having more error details available is worthwhile.