This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: message primitive
- To: "Greg J. Badros" <gjb at cs dot washington dot edu>
- Subject: Re: message primitive
- From: Mikael Djurfeldt <mdj at mdj dot nada dot kth dot se>
- Date: 09 Jan 2000 10:00:30 +0100
- Cc: guile at sourceware dot cygnus dot com, djurfeldt at nada dot kth dot se
- Cc: djurfeldt at nada dot kth dot se
- References: <qrriu14jfbt.fsf@clavicle.cs.washington.edu> <xy7so07k4g5.fsf@mdj.nada.kth.se>
Mikael Djurfeldt <mdj@mdj.nada.kth.se> writes:
> "Greg J. Badros" <gjb@cs.washington.edu> writes:
>
> > The error handling code has a printf-like formatting capability such
> > that %S and %s format subsequent arguments as write or display style
> > output, respectively. This seems generally useful, but is not available
> > at the scheme level
>
> What about
>
> (scm-error 'frukost-error 'nisse
> "Found %s in %s" (list 'socka 'filmjölken)
> '())
In GOOPS, I've defined:
;;
;; goops-error
;;
(define (goops-error format-string . args)
(save-stack)
(scm-error 'goops-error #f format-string args '()))
which I then use like
(goops-error "malformed superclass list: %S" (supers exp))