IRC channel logs

2026-08-23.log

back to list of logs

<haugh>long after implementing it myself, I discovered the (undocumented!) simple-exceptions procedure in guile core by mindlessly tab-completing in the REPL
<haugh>Why isn't this in the manual? Should I avoid it for any reason?
<graywolf>Hi :) What is conventional way to report errors from syntax forms? I am currently raising an condition with make-syntax-violation, make-message-condition and make-irritants-condition, but am unsure how to report source location.
<graywolf>Is there some suitable error type for that? How is this usually done?
<rlb>graywolf: perhaps https://doc.guix.gnu.org/guile/latest/en/html_node/Syntax-Rules.html#Reporting-Syntax-Errors-in-Macros
<graywolf>Interesting, syntax-error seems to always fire, even when inside (unless #f). Maybe it can be used only with syntax-rules, and not with syntax-case.
<rlb>Ahh, OK --- and looks like it's provided by psyntax.scm itself.
<rlb>graywolf: looks like the guile-syntax-error-converter creates a compound exception of syntax-error, exception-with-origin, and exception-with-message when going from old-style 'syntax-error to exception objects.
<rlb>but the origin may just be the function name?
<rlb>I suspect Olivier may already know more here.
<graywolf>It sadly discards the `where' part, which based on the name, is the one interesting to me. I will just make a wrapper error type, I think that should work fine. I just wanted to make sure there isn't some idiomatic way I overlooked.
<rlb>My general impression is that we still have some work to do wrt "new exceptions". Reminds me, I still have that patch to add &exception-with-errno so we can stop dropping the errno value when promoting a 'system-error to a condition object.