Re: [racket-users] Suppress print lines from required modules

2017-08-27 Thread Matthew Butterick
> On Aug 27, 2017, at 7:30 PM, Shu-Hung You > wrote: > > Something along the line of (open-output-file > "/dev/null") sounds a bit better but I'm not sure how to create a > discard-everything output port. `open-output-nowhere`? https://docs.racket-lang.org/reference/port-lib.html?q=open-outp

Re: [racket-users] Suppress print lines from required modules

2017-08-27 Thread Shu-Hung You
Parameterizing current-output-port to (open-output-string) redirects the output to a string. Something along the line of (open-output-file "/dev/null") sounds a bit better but I'm not sure how to create a discard-everything output port. (define ns (make-base-namespace)) (parameterize ([current-na

[racket-users] Suppress print lines from required modules

2017-08-27 Thread Sam Waxman
Let's say I have a module that looks like (module a racket (provide result) (print "Annoying print line!") (define result 2)) and I'd like the value of result in another module, so in another module, I write (require a) or (dynamic-require ''a 'result) In both cases, I get the value