libera/#commonlisp - IRC Chatlog
Search
13:57:49
jackdaniel
the second branch has (trivial-backtrace:print-backtrace condition nil), but nil is in the position of the keyword argument
13:58:12
dim
4: (SB-KERNEL:WITH-SIMPLE-CONDITION-RESTARTS SIGNAL NIL #<CODE-DELETION-NOTE "deleting unreachable code" {1008468C33}>)
13:59:46
jackdaniel
first: trivial-backtrace prints the backtrace with a message "FATAL error: …" (and it is not a fatal error)
14:00:06
jackdaniel
then the control is transferred to the handler-case's case CONDITION that prints "What am I doing here"
14:00:43
jackdaniel
if you replace the last clause name with serious-condition, then handler-case will simply glide over and move to "done"
14:00:53
dim
whenever something I didn't account for is happening, the program stops and might display a backtrace
14:01:27
dim
here the thing that I didn't account for is a compiler warning (note: deleting unreachable code) that I'd like to ignore
14:01:31
jackdaniel
you should replace the last clause in handler case ("What I am doing here?") with serious-condition instead of condition
14:01:48
Bike
when you say "ignore", do you mean you'd like the program to not do anything special, or that you'd like to actually suppress the message
14:02:00
Bike
regardless, you really actually should not treat all conditions as fatal errors, because they're not
14:02:15
jackdaniel
the condition CONDITION subsumes all warnings, errors, notes and innocent signals
14:02:26
Bike
ok, then all you have to do is replace CONDITION with SERIOUS-CONDITION or ERROR or something
14:02:44
jackdaniel
yes, you deliberely handle things like compiler notes and call uiop:quit on them
14:03:12
jackdaniel
yes, serious-condition is an error + some things that are not errors in code (timeout, out of memory etc)
14:03:48
jackdaniel
also I wouldn't write "FATAL error" in your backtrace printer, I'd print the condition class name (because that was confusing)
14:03:52
dim
should I still process warnings-p and failure-p output from the call to (compile nil source)?
14:06:45
dim
(let ((c (make-condition 'simple-error :format-control "error"))) (class-name (class-of c)))
14:10:44
dim
PR updated at https://github.com/dimitri/pgloader/pull/1411 with your feedback jackdaniel and Bike ; thanks
14:11:06
dim
let's see what the unit tests make of the current code, and then I'll ask my debian friend to test again with sid and SBCL 2.2.6
14:13:12
jcowan
aeth: does that mean that fedora/etc. will stop supporting xwayland? That would really be a disaster, and not just for WMs
14:14:17
jackdaniel
dim: in your handler-bind you handle all conditions (except for a few chosen ones) and print the backtrace for them - do you want to print a backtrace i.e for compiler notes?
14:18:05
NotThatRPG
It would be neat if something like UIOP provided some common condition classes usable across implementations
14:19:05
jackdaniel
another interesting trick in a toolbox is to have a macro like handler-case (let's call it handler-case*), that handles the condition, then unwind the stack and returns; then printing the backtrace in this situation could be done in the last serious-condition clause
14:19:34
jackdaniel
putting aside details like properly handling :no-error and multiple return values, writing such macro based on handler-bind is rather trivial
14:29:58
hayley
I believe I have a handler-case* somewhere, based off Pitman's condition system code.
14:31:24
NotThatRPG
@jackdaniel: I don't believe that there's a class that corresponds to compiler notes, for example.
14:32:54
hayley
But (deftype silly-condition () '(and condition (not serious-condition))) is useful.
14:33:39
jackdaniel
some conditions are not silly though! signaling partial results in an otherwise synchronous body is one example
14:34:27
NotThatRPG
hayley: Yes, it would be nice if one could make code that wraps around compilation, that could portably handle different implementations' equivalent of compiler notes (assuming that these are implemented as conditions of some sort).
14:35:13
aeth
jcowan: no, but afaik (based on another IRC channel anyway) Fedora would move exclusively to xwayland
14:40:44
Bike
shinmera and i have been talking about doing that, notthatrpg. it would basically be ripping out part of swank. i think my main conceptual confusion now is why sbcl "compiler errors" aren't actually errors
14:41:02
Bike
also i'll have to check if any implementations have a compile that never signals and only reports problems some other way, which would be annoying
14:46:07
Bike
i will see what i can do. i'm doing a bunch of other stuff for clasp at the moment, though
15:25:00
Bike
allegro has a compiler-note class but swank at least treats it as unexported. the abcl code looks like you have to bind an internal dynamic variable to make the compiler actually signal warnings. geh.