> On Aug 10, 2016, at 8:04 AM, Robby Findler <ro...@eecs.northwestern.edu> 
> wrote:
> 
> This is the change to DrRacket:
> 
>  
> https://github.com/racket/drracket/commit/edfea2c649d4d1cfdc2c9facf4dbdb4663be0a07
> 
> (you'll want the subsequent commit too, tho).
> 
> I believe this fixes a bug in DrRacket but the way these handlers are
> set up is pretty complicated. Here's an example program that behaves
> differently in 6.6 and the version with those commits. I think the 6.6
> behavior is wrong (i.e. the newlines between the three numbers should
> be appearing). My inference is based on a reading of the docs and some
> experimentation with the racket binary. In particular, the docs say
> that `print` should be printing a newline, and they say that `print`
> should be calling the global-port-print-handler. Thus, even when the
> global-port-print-handler doesn't print a newline we should still see
> one.

When I read the docs to see what `#lang constructor-style-print` should do, it 
said two things. One, that `current-print` should print a newline. Two, that 
`global-port-print-handler` and `print` should do the same thing, which is 
*not* print a newline, because `print` doesn't print one (that's `println`'s 
job).

> #lang racket
> (global-port-print-handler
> (λ (val port [depth 0])
>   (fprintf port "~s" val)))
> 
> 1 2 3
> 
> Robby
> 
> 
> On Wed, Aug 10, 2016 at 7:50 AM, Alex Knauth <alexan...@knauth.org> wrote:
>> 
>>> On Aug 10, 2016, at 7:34 AM, Delphine Demange <delphine.dema...@gmail.com> 
>>> wrote:
>> 
>>>> The `constructor-style-print` function isn't supposed to add a newline.
>>> 
>>> Okay, I got confused because in DrRacket, running
>>> 
>>> ----------
>>> #lang constructor-style-print racket
>>> true
>>> false
>>> (cdr (list 1 2 3))
>>> ----------
>>> 
>>> was resulting in
>>> ----------
>>> #t#f(list 2 3)
>>> ----------
>>> (no whitespace, no newline) in the interaction window. But here again, 
>>> maybe the initial use case was not including this kind of program either.
>>> 
>>> From the racket REPL, which is what I really need, it does behaves 
>>> correctly without the call to pretty-write.
>> 
>> Oh, that's really weird...
>> 
>> And not just on the repl, running `racket test-constructor-style-print.rkt` 
>> with that text also prints newlines. I guess DrRacket is doing something 
>> weird now, that it wasn't doing before.
>> 
>> In 6.0, it prints the newlines properly, but in 6.6.0.2 it works on the 
>> command-line but not in DrRacket. Did DrRacket change it's behavior recently?
>> 
>> Alex Knauth
>> 
>>> Thanks for the feedback, Alex.
>>> 
>>> Delphine
>> 
>> --
>> 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.

-- 
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.

Reply via email to