Re: [racket-users] Change how to print builtins

2017-06-27 Thread Matthew Flatt
Besides struct-specific printing, the pretty printer from
`racket/pretty` provides a hook for changing the printed form of
anything via `pretty-print-size-hook` plus `pretty-print-print-hook`.

At Thu, 22 Jun 2017 18:39:15 -0700 (PDT), Sam Waxman wrote:
> Hello,
> 
> I was having trouble figuring out how to get racket to print values however I 
> wanted. In particular, I was hoping to make exact nums print as decimals and 
> true print as true (and not #t or #true). It would also be nice if I could 
> custom print procedures so that + printed as plain old + or in some other 
> yet-to-be-decided format. There might be other minor cosmetic things I'd like 
> to do in the future, so if there's a general way to write my own printer, 
> that 
> would be preferred, but if there are builtin features just to do the first 
> two 
> specific things, that would be pretty helpful too.
> 
> (I have to imagine there are pretty good ways to do this considering 
> user-defined #langs could print out all sorts of things, and they're not just 
> wrapping all their values in structs with custom print settings are they?)
> 
> Many thanks in advance
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Change how to print builtins

2017-06-23 Thread David Storrs
For myself, I would like some better pretty-printing of nested data
structures and for structs to have their field names included with the
values so that they printed in a more hash-like format.

On Thu, Jun 22, 2017 at 9:39 PM, Sam Waxman  wrote:

> Hello,
>
> I was having trouble figuring out how to get racket to print values
> however I wanted. In particular, I was hoping to make exact nums print as
> decimals and true print as true (and not #t or #true). It would also be
> nice if I could custom print procedures so that + printed as plain old + or
> in some other yet-to-be-decided format. There might be other minor cosmetic
> things I'd like to do in the future, so if there's a general way to write
> my own printer, that would be preferred, but if there are builtin features
> just to do the first two specific things, that would be pretty helpful too.
>
> (I have to imagine there are pretty good ways to do this considering
> user-defined #langs could print out all sorts of things, and they're not
> just wrapping all their values in structs with custom print settings are
> they?)
>
> Many thanks in advance
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Change how to print builtins

2017-06-22 Thread Sam Waxman
Hello,

I was having trouble figuring out how to get racket to print values however I 
wanted. In particular, I was hoping to make exact nums print as decimals and 
true print as true (and not #t or #true). It would also be nice if I could 
custom print procedures so that + printed as plain old + or in some other 
yet-to-be-decided format. There might be other minor cosmetic things I'd like 
to do in the future, so if there's a general way to write my own printer, that 
would be preferred, but if there are builtin features just to do the first two 
specific things, that would be pretty helpful too.

(I have to imagine there are pretty good ways to do this considering 
user-defined #langs could print out all sorts of things, and they're not just 
wrapping all their values in structs with custom print settings are they?)

Many thanks in advance

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.