This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
message primitive
- To: guile at sourceware dot cygnus dot com
- Subject: message primitive
- From: "Greg J. Badros" <gjb at cs dot washington dot edu>
- Date: 08 Jan 2000 15:47:50 -0800
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, directly-- at least not that I can find [closest is
`display-error':
SCM_DEFINE (scm_display_error, "display-error", 6, 0, 0,
(SCM stack, SCM port, SCM subr, SCM message, SCM args, SCM rest),
but that has extra STACK PORT and SUBR arguments. Would others like a
`message' primitive that would work like so:
(message "Foo: %S %s" (list "a" "b"))
outputs:
Foo: "a" b
?
Note that this primitive already exists as a C-only function,
scm_display_error_message, that we would just need to expose in the
API. How do people feel about R[45]RS compatibility issues? Is there
an easy way to require that a module be loaded before a primitive is
accessible? We could call it `%message' and have some module re-export
the primitive under the nicer name `message', I suppose.
Thanks for feedback!
Greg