[plt-scheme] printing question
Chongkai Zhu <czhu at cs.utah.edu> wrote:
>
> Sorry but scheme_char_string_to_byte_string might trig the GC, so what
> I just suggested is wrong. You might consider first getting
> SCHEME_CHAR_STR_VAL, and then using scheme_utf8_encode functions,
> which are described in section 11 of "inside mzscheme" doc to get C
> char*.
Thank you, that makes sense. Turning off GC hadn't made sense to me,
which I guess is why I was stuck. But tell me, all I want to do is to
print out a formatted scheme string, and this seems way more trouble
than it's worth. But I had tried using scheme_printf(), but with this:
if (SCHEME_CHAR_STRINGP(argv[1])) {
scheme_printf("Waiting to start: ~a~n",22,1,&argv[1]);
I get this:
> (trigger "jello")
printf: format string requires 0 arguments, given 1; arguments were: "jello"
Do I need to escape the tildes in some way? Or is there something else
dumb I'm doing here?
Many thanks,
-tom
--
------------------------
tomfool at as220 dot org
http://sgouros.com
http://whatcheer.net