DrRacket pulls some shenanigans with the language dialog-based
teaching languages and it needs some adjust to make things work the
way you want with printing in 'raco test' and 'racket'. Probably there
isn't a simple path to that precise goal, but maybe there is a way to
another goal?

Is it the case that you're trying to get things set up so that output
that you produce running inside the handin server is suitable to be
presented to students so that you can tell them that their submission
failed somehow? (In which case, I might just prefix the error message
with "This is not exactly the error that you will see in DrRacket,
where you'll get a clearer message. Please run your program there.")

My hope is to find time to get the #lang htdp/bsl (etc) languages up
to stuff so that my advice would switch to "use #lang htdp/bsl and all
will be fine" but I'm not there yet.

Robby


On Thu, Nov 26, 2015 at 6:16 PM, Paolo Giarrusso <p.giarru...@gmail.com> wrote:
> Hi all!
>
> How does the REPL print values? In some circumstances I see graph printing 
> markers, even though `(print-graph)` is disabled. Because these are error 
> messages for students using teaching languages, cycle printing is not an 
> option.
>
> messages.rkt> (print-graph)
> #f
> messages.rkt> (list (game-state p p p))
> (list (game-state (posn 150 100) (posn 150 100) (posn 150 100)))
> messages.rkt> (~v (list (game-state p p p)))
> "(list (game-state #0=(posn 150 100) #0# #0#))"
>
> Funnily, that doesn't happen in DrRacket, but it does happen both in 
> racket-mode, in my actual production environment, and under raco test. In 
> particular, test results in DrRacket are the ones I'd want, but are 
> inconsistent with the ones everywhere else.
>
> Apart from being frustrated at parameters, how do I gain control over this?
>
> PS: I've just found that `global-port-print-handler` is customized by 
> DrRacket. That seems incompatible with using `print` and relying on it 
> producing certain results. I understand that's the point of `print`, but 
> neither `write` nor `display` does what I want.
>
> HTDP code itself uses `~e` (also in htdp/error), but finding the appropriate 
> handler to install isn't trivial either; and that's not enough, because 
> sometimes I need to show the source code we evaluated.
>
> Sorry for how chaotic is this message — I guess that reflects my confusion at 
> Racket printing. (I've taken some looks at the relevant documentation, but 
> not at all of it).
>
> Cheers,
> Paolo
>
> --
> 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