[racket] Format Bug

From: Curtis Dutton (curtdutt at gmail.com)
Date: Tue Jun 8 15:19:08 EDT 2010

Thanks. I started to think that was  what was going on after I sent the
mail. Doh!
Thanks for the explanation.

On Jun 8, 2010 3:09 PM, "Carl Eastlund" <cce at racket-lang.org> wrote:

On Tue, Jun 8, 2010 at 2:47 PM, Curtis Dutton <curtdutt at gmail.com> wrote:
> Just found a quick littl...
This is not a bug in format, but rather a peculiarity of the "print"
function and different kinds of output ports.  Try the following in
DrRacket:

(print (+ 11 (/ 5 16)))

(newline)

(with-output-to-string
 (lambda ()
   (print (+ 11 (/ 5 16)))))

The fraction displayed as 5 over 16 with a line between is not, in
fact, a string, but is instead an image.  DrRacket uses a special
output port that can display graphical images; but format and
with-output-to-string use a port that can only accept characters.  The
print function distinguishes between these kinds of ports and decides
how to render fractions accordingly.

--Carl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20100608/99fd0baa/attachment.html>

Posted on the users mailing list.