sorawee
2021-7-3 08:13:59

Yep, that works. Thanks!


sorawee
2021-7-3 08:14:34

Can anyone explain what 'maybe means for prop:custom-print-quotable?


soegaard2
2021-7-3 09:08:48

It affects how structures are printed.


sorawee
2021-7-3 09:11:03

Ah, thanks! I couldn’t find 'maybe from that page. Perhaps there should be a hyperlink to the page you show above


soegaard2
2021-7-3 09:12:24

It says “see <https://docs.racket-lang.org/reference/printing.html?q=prop%3Acustom-print-quotable|The Printer>.” but a direct link to the the paragraph above would be better.


sorawee
2021-7-3 09:14:20

Ahhh, I missed that :face_palm:


sorawee
2021-7-3 09:15:25

Thanks!


soegaard2
2021-7-3 16:53:03

Reminder: Racket Users Video Meetup (Saturday, July 3 at 20.00 UTC)



laurent.orseau
2021-7-3 20:27:02

Is it possible to control the number of columns of the output of examples from scribble/example? I tried parameterizing print-value-columns and pretty-print-columns above the call to make-evaluator but this didn’t work


laurent.orseau
2021-7-3 20:29:08

#lang scribble/manual @(require scribble/example racket/sandbox racket/pretty) @(define the-eval (parameterize ([sandbox-output 'string] [sandbox-error-output 'string] [sandbox-memory-limit 50] [pretty-print-columns 70]) (make-evaluator 'racket/base #:requires '(racket/string)))) @(examples #:eval the-eval #:once (list "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed" "do eiusmod temporincididunt ut labore et dolore magna" "aliqua. Ut enim ad minim veniam, quis nostrudexercitation" "ullamco laboris nisi ut aliquip ex ea commodo consequat." "Duis aute iruredolor in reprehenderit in voluptate velit" "esse cillum dolore eu fugiat nulla pariatur.Excepteur sint" "occaecat cupidatat non proident, sunt in culpa qui officia" "deseruntmollit anim id est laborum."))


mflatt
2021-7-3 20:29:35

Does something like @examples[#:eval the-eval #:hidden (pretty-print-columns 70)] work?


mflatt
2021-7-3 20:31:11

I think the parameterize above doesn’t work because the sandbox will have a new instance of racket/pretty, with means new parameters. But maybe another way to go is to attach the existing racket/pretty to the sandbox. You might have to drop down to the racket/sandbox level to do that.


laurent.orseau
2021-7-3 20:32:49

The first suggestion didn’t work unfortunately


laurent.orseau
2021-7-3 20:33:07

Right, i see why my first attempt failed


mflatt
2021-7-3 20:35:32

Oh, I see why the parameter setting in the sandbox doesn’t matter. The value isn’t being printed, but is being returned from the sandbox as a result, then formatted at the Scribble layer.


laurent.orseau
2021-7-3 20:37:46

I can’t find anything in Scribble to control the output format. is there any?


mflatt
2021-7-3 20:38:53

There’s more information in the documentation of examples… but if I change your code to use make-base-eval, then it gets wrapped the way you’d expect. I think that’s because make-base-eval (instead of working at the racket/sandbox level) sets up this part for you.


laurent.orseau
2021-7-3 20:40:18

ah, wonderful, that works! Many thanks!


mflatt
2021-7-3 20:40:20

That is, when the documentation for examples says “the default printer”, it may mean the one for make-base-eval. If that’s right, then the documentation needs to be improved, of course.


sorawee
2021-7-3 21:02:01

What would be the cause of open-output-file: the current custodian has been shut down? I’m really confused because this program doesn’t use thread/custodian or anything like that and it runs fine on M1, but errors on Linux, very consistently


sorawee
2021-7-3 21:05:15

Oh, I have Racket 8.1 on Linux, but 8.2 on my M1. Could that be the cause? Let me try 8.1 on M1…


sorawee
2021-7-3 21:10:22

Yep. It’s 8.1 vs 8.2


mflatt
2021-7-3 21:18:48

Looks like the documentation is correct, in that “default” really means the default generically. But using make-base-eval fixes things, because that makes an evaluator with the printer set to pretty-print (i.e., the printer is not the default one).


sorawee
2021-7-3 21:22:12

@mflatt do you know what could have caused this and/or which commit fixes the problem?


mflatt
2021-7-3 22:00:58

That error by itself doesn’t bring anything to mind.


sorawee
2021-7-3 22:03:17

Yep, it’s my fault. Just found it’s a stale compilation issue