[plt-scheme] results

From: Daniel Silva (dansilva at lynx.dac.neu.edu)
Date: Mon Nov 18 21:20:16 EST 2002

To print python results.  For example, python dictionaries are displayed
as

{key1: value1, ...}

I can get a dictionary to look like that if I format a string, but then
my output is:

"{'key': 2, 'another key': 9}"

Printing without the quotation marks would make it more natural to the
python user.  I heard Algol used printf for everything, but it would be
nice if python behaved just like the scheme languages.

Daniel
 

> -----Original Message-----
> From: plt-scheme-admin at qua.cs.brown.edu [mailto:plt-scheme-
> admin at qua.cs.brown.edu] On Behalf Of Robert Bruce Findler
> Sent: Monday, November 18, 2002 9:04 PM
> To: Daniel Silva
> Cc: 'plt-scheme'
> Subject: Re: [plt-scheme] results
> 
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> 
> At Sun, 17 Nov 2002 14:02:34 -0500, "Daniel Silva" wrote:
> > If I say "hello" to drscheme or mzscheme, it says "hello" back to
me,
> > and if I say (list 1 2 3), it says (1 2 3) back to me.  How do I
make it
> > say hello in the first case (no quotes), and [1 2 3] in the second
> > without using display/write/print/printf?  Maybe even [1, 2, 3] for
that
> > one.
> 
> I think that you need to write your own printer, or maybe your own
> pretty printer. MzScheme's implementation of pretty print is one place
> to start if you need a pretty printer. I'm not sure why you don't want
> to use any of the output routines, however. Probalby you can use
> display, but only pass it strings. What is the larger context?
> 
> Robby



Posted on the users mailing list.