[plt-dev] strange behavior with printf, format, and unsyntax

From: Jon Rafkind (rafkind at cs.utah.edu)
Date: Thu Sep 10 12:59:33 EDT 2009

Sam TH wrote:
> This program:
>
> #lang scheme
>
> (display (format "~a~n" '(scheme #,3)))
> (format "~a~n" '(scheme #,3))
> (printf "~a~n" '(scheme #,3))
>
> Produces these results:
>
> (scheme (unsyntax 3))
> "(scheme (unsyntax 3))\n"
> (scheme #,3)
>
> which rather surprised me.  Why is `printf' behaving differently from `format'?
>   
It prints (unsyntax 3) for me.

(scheme (unsyntax 3))
"(scheme (unsyntax 3))\n"
(scheme (unsyntax 3))

 $ mzscheme --version
Welcome to MzScheme v4.2.1.8 [3m], Copyright (c) 2004-2009 PLT Scheme Inc.



Posted on the dev mailing list.