IRC channel logs


back to list of logs

<apteryx>re my previous question, it boils down to how to handle the exception corresponding to 'exit'
<graywolf>Hi, quick question, how can I debug *why* does guile auto compile a file? I have a .go in %load-compile-path, so I would like to find out why it is not used.
<apteryx>so (exit n) sends throws a 'quit keyed exception
<apteryx>I can use quit-exception? to check for it via (ice-9 exceptions)
<civodul>i think it’s still a key-and-arg exception, no?
<civodul>hmm apparently it’s both: (with-exception-handler identity (lambda () (exit 42)) #:unwind? #t)
<civodul>so yes, you can use ‘quit-exception?’
<civodul>ah yes, that comes from ‘guile-exception-converters’
<haugh>Guile's exception system(s) is (are) complicated.
<civodul>well, the transition to structured exception objects complicates it
<apteryx>it's a bit weird we settled on something almost the same but also different than srfi-34 and srfi-35; I think the only difference is in how the exception type is created/instantiate?
<apteryx>(with (ice-9 exceptions))
<haugh>there are more differences than that
<haugh>e.g. guile's implementation of guard is tricky in that the conditional clauses are executed in the error cont
<apteryx>are they interoperable, e.g. can I use (ice-9 exceptions)'s guard to catch/handle srfi-35 conditions and vice-versa?
<apteryx>I'm not a big fan of the instantiation that looks something like: '(make-my-exception something-inherited-in-grand-parent something-inherited-in-parent my-field)
<apteryx>but I haven't used it enough to make myself comfortable with it, maybe.
<haugh>I feel you but at least it's flexible enough that you can just use it exclusively and not worry about the older systems
<apteryx>it at least forces you to know what you are doing
<apteryx>yes, that's great! I'm happy Guile now has its own modern exception handling capabilities. I always refer to that excellent blog post when working with exceptions in Guile:
<haugh>TIL exception-kind
<apteryx>hm... I'm puzzled by this:
<apteryx>I'm trying to process Scheme *as data* and take the inner list from '`((item1 item2)), and getting a weird syntax error: unquote: expression not valid outside of quasiquote in form (unquote (quote (("guile-hall" (hall common) (unquote guile-hall)) ("guix" (unquote guix)))))
<RhodiumToad>why are you using unquote there?
<RhodiumToad>note that ` is a reader shorthand for unquote
<RhodiumToad>er, quasiquote
<RhodiumToad>, is unquote
<RhodiumToad>dependency field", <-- what's that comma doing there?
<apteryx>it's to match the beginning of the expected data
<RhodiumToad>the comma on that test-equal line is what messes it up, you didn't have that when trying it in the repl
<apteryx>ha! I failed to see that
<apteryx>it's getting late. thanks for your good eyes.
<RhodiumToad>that's where the outermost unquote is coming from, and that's the one with the error
<apteryx>works :-)
<apteryx>I think I'll stop my hacking session here, eh. good day/night!
<apteryx>hi! any idea how I could turn this ('quasiquote (var ...)) pattern into `(,var ...) ? I couldn't get it to work:
<RhodiumToad>apteryx: why is quasiquote quoted there?
<apteryx>because it's processed as data
<apteryx>is there a way to temporarily redirect current-output-port to a string port?
<apteryx>ah, with-output-to-port