[racket] What part of the Reader reads procedures?

From: Daniel Brady (dabrady at umail.iu.edu)
Date: Tue Jun 10 22:41:13 EDT 2014

Ahhh, I must have been trying to use print-unreadable in one of those
modes, then. Thanks for pointing that out.

I'll look into pretty-printing and see what it does for me. Thanks!


On Tue, Jun 10, 2014 at 1:28 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:

> Procedures are unreadable, and `print-unreadable` does affect printing
> in the default mode:
>
>  > (print-unreadable #f)
>  > (lambda (x) x)
>  write: printing disabled for unreadable value
>    value: #<procedure>
>
> I see that Constructor and Quaisquote modes in DrRacket don't pay
> attention to `print-unreadable`, though, and that may be confusing you.
>
> There are various ways to change the printing of procedures, each with
> some trade-offs. One option is to use `pretty-print` and set the
> `pretty-print-size-hook` and `pretty-print-print-hook` parameters to
> recognize
>
> At Mon, 9 Jun 2014 20:02:32 -0400, Daniel Brady wrote:
> > In the documentation on the the Reader, I see all of the data types in
> > Racket that I knew about (and more) have sections devoted to reading
> them,
> > except for procedures. What part of the reader handles procedures?
> >
> > In my Reader experiments I wanted to see if I could change the output of
> > reading a procedure, like I could numbers and quoted values, but I
> couldn't
> > figure out how to catch them.
> >
> > They apparently aren't read via #%datum, and they aren't being treated as
> > an 'unreadable value' because they display the same whether or not
> > print-unreadable is turned on. The only difference in how the value of a
> > procedure displays is through changing the output printing style of
> > DrRacket itself, from print/write to constructor/quasiquote.
> >
> > I don't want to change this mode, however; I'm just interested in
> changing
> > the displayed value of evaluated procedures to a customized value, like
> > "#<function>" instead of "#<procedure>" or something.
> >
> > --
> > *SEE YOU SPACE COWBOY...*
> > ____________________
> >   Racket Users list:
> >   http://lists.racket-lang.org/users
>



-- 
*SEE YOU SPACE COWBOY...*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140610/378424a0/attachment.html>

Posted on the users mailing list.