bug#41956: [PATCH] ice-9: exceptions: Properly format the error message.

Maxim Cournoyer <[email protected]>
Newsgroups gmane.lisp.guile.bugs
Message-ID <[email protected]>
Hello Bengt,

Bengt Richter <[email protected]> writes:


[...]

> What do you think of using (ice-9 match) to make a universal throwage-formatter,
> with the idea of making readable top level code for how exceptions become messages on screen?
>
> I started a hack to explore the (throw 'whatever any ...) space, beginning like
>
> (use-modules (ice-9 match))
> (define (make-exception-message key rest)
>   (begin
>     (let*((l (cons key rest)))
>       (match l
> 	     (('system-error subr message args data ...)
> 	      ;; e.g. thrown with key 'system-error: ("open-fdes" "~A" ("No such file or directory") (2))
> 	      (format #f (string-append "match-1: subr ~s threw '~s " message " sterror: ~s") subr key args (strerror (car (car data)))))
>
> 	     (('signal   any ...)
>               ;; not yet implemented
> 	      (format #f "match-2: <NYI:unix signal no> any: ~s" any))

Are you proposing to refactor (ice-9 exceptions) so that it's simpler to
follow a condition message is formed for a given exception type?

Maxim
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.