hunter.t.joz
2018-7-31 13:01:55

How can I compile the Racket manuals to a different format? I see them in the source tree, but I wonder if they can be made in to a DAISY format as my BrailleSense won’t load the HTML versions.


soegaard2
2018-7-31 13:03:35

@hunter.t.joz Besides html I know scribble can generate pdf and markdown.


soegaard2
2018-7-31 13:03:52

The pdfs are on the web page. Somewhere.


samth
2018-7-31 13:03:54

@hunter.t.joz you can use the raco scribble command to generate various backend formats


samth
2018-7-31 13:04:12

thinkmoore
2018-7-31 14:21:04

a colleague is experimenting with Racket and has two #lang questions I feel like I should have been able to answer but I’m a bit too rusty. 1) Can you have a submodule with a different #lang/reader in one file? and 2) why do some languages (e.g. rash) complain about a missing module-begin when used as the language of a submodule (i.e. (module something rash ...)?


pocmatos
2018-7-31 14:55:13

If I want to plot histograms with error bars, is there a straightforward way to do this or do I always have to couple a discrete-histogram and an independent error-bars 2drenderer? Doing the coupling is ok, even if annoying as it forces you to properly compute the error bars x position. However, the biggest issue is that then it overlays two x-ticks: one from the histogram and one from the error-bars. The latter should be ignored.


pocmatos
2018-7-31 15:08:35

I took a few benchmarks using speedometer2.0 and obtained the following: (define speedometer2.0 '((brave . (55.80 . 0.55)) (vivaldi . (87.3 . 1.4)) (firefox . (32 . 0.88)) (chrome . (87.5 . 1.1))))


pocmatos
2018-7-31 15:08:36

To plot:


pocmatos
2018-7-31 15:09:29
(define (plot-speedometer)
  (plot (list (discrete-histogram (for/list ([browser-result (in-list speedometer2.0)]
                                             [idx (in-naturals)])
                                    (define browser (car browser-result))
                                    (define value (car (cdr browser-result)))

                                    (list browser value))
                                  #:skip 2.5)
              (error-bars (for/list ([browser-result (in-list speedometer2.0)]
                                     [idx (in-naturals)])
                            (define browser (car browser-result))
                            (define value (car (cdr browser-result)))
                            (define error (cdr (cdr browser-result)))

                              (list (+ 0.5 (* idx 2.5)) value error))))
        #:x-label "Browser"
        #:y-label "Runs / second"
        #:title "Speedometer 2.0 (higher is better)"))

pocmatos
2018-7-31 15:10:18

The problem with this is that unfortunately the x-ticks mention the browser names and the ticks from the error bars. How can I remove the ticks from the error bars?


pocmatos
2018-7-31 15:10:46

ben
2018-7-31 16:02:55

@pocmatos (parameterize ((plot-x-ticks no-ticks)) (plot ....))


ben
2018-7-31 16:03:18

those extra ticks are just the default for the whole plot area


pocmatos
2018-7-31 16:07:42

@ben thanks. interesting. I expected that to remove the brave, vivaldi, etc ticks. Why didn’t it?


ben
2018-7-31 16:08:30

those are the #:add-ticks? from discrete-histogram


greg
2018-7-31 18:53:20

https://racket.slack.com/archives/C06V96CKX/p1533046864000470 @thinkmoore 1. I think No — but would be interested to learn otherwise. 2. I don’t know. @willghatch might know, for rash?


soegaard2
2018-7-31 19:09:54

@thinkmoore ad 1.) This is in the ball park. Maybe @alexknauth know more? http://docs.racket-lang.org/multi-file-lang/index.html


samth
2018-7-31 20:44:10

@thinkmoore 2 is probably because #lang rash reads to (module m rash/something-else ...)


thinkmoore
2018-7-31 20:50:40

ah, that makes sense. thanks, both


thinkmoore
2018-7-31 20:51:27

I vaguely recall someone was working on a library that let you do different kinds of quoting/reading using different delimeters but couldn’t find it on the pkg server


gregor.kiczales
2018-7-31 21:50:10

I don’t know these days whether to report problems here or through DrRacket, but the following program gives me a `read’ access denied for .LOCKpkgs.rktd. #lang racket/base

(require racket/sandbox) ;(require racket/gui) ;(require “handin-server/sandbox.rkt”) ;!!! need this.

(define bar 1)

(define foo (make-evaluator ‘(special intermediate) ’() ;(open-input-graphical-file “test/tester/hw.rkt”) ))


capfredf
2018-7-31 21:51:32

@capfredf has joined the channel


soegaard2
2018-7-31 21:52:34

@gregor.kiczales What happens when you delete the lock?


soegaard2
2018-7-31 21:52:48

Same thing?


gregor.kiczales
2018-7-31 21:54:18

It comes right back when I re-run and I get the error.


soegaard2
2018-7-31 21:55:11

@zenspider Had a similar problem. Did you solve it? https://github.com/racket/drracket/issues/123


zenspider
2018-7-31 22:01:23

@soegaard2 no, I never solved it. I think I punted outright after filing that issue


capfredf
2018-7-31 22:18:16

Hello, everyone. A quick question about composable continuations: The expression (+ 1 (call-with-composable-continuation (lambda (k) (+ 10 (k 10))))) in REPL gives me back 22, which is expected. However, if I run the file shown below: #lang racket (+ 1 (call-with-composable-continuation (lambda (k) (+ 10 (k 10)))))

I will get an error: ; +: contract violation ; expected: number? ; given: #&lt;void&gt; ; argument position: 2nd ; other arguments...: ; Context: ; ~/tmp/test.rkt:2:40 ; ~/tmp/test.rkt:1:1 why does the application of the captured continuation return #<void> here?


soegaard2
2018-7-31 22:29:11

@capfredf All repl interactions are wrapped in a prompt.


soegaard2
2018-7-31 22:29:14

Try


soegaard2
2018-7-31 22:29:15

(require racket/control) (prompt (+ 1 (call-with-composable-continuation (lambda (k) (+ 10 (k 10))))))


soegaard2
2018-7-31 22:31:21

Also in a module expressions at are wrapped in a print - so the void you see is the result of printing 11.


soegaard2
2018-7-31 22:32:13

That is, without the prompt too much of the continuation is caught.


capfredf
2018-7-31 22:34:15

@soegaard2 That makes sense. Thank you very much.


soegaard2
2018-7-31 22:35:14

It’s a bit confusing in this case that expressions are implicitly wrapped in a print, but it is very convenient, when not dealing with continuations.


hunter.t.joz
2018-7-31 22:39:42

Okay, will give that a try.


gregor.kiczales
2018-7-31 22:52:13

For us the inability to import racket/sandbox is a pretty big problem right now. The term starts in a month and we are trying to set up our world.


samth
2018-7-31 23:38:25

@gregor.kiczales the usual approach is to allow the sandbox read access to the whole file system


gregor.kiczales
2018-8-1 00:39:07

I’m not sure I understand the suggestion you are making. How do I effect what you are suggesting? The sandbox module has no specific configurations about file system access that I can see.



samth
2018-8-1 01:34:27

just setting (sandbox-path-permissions (list (list 'read "\"))) should make things work


philip.mcgrath
2018-8-1 06:08:24

@zenspider The failure to hide on Mac is a known issue since Racket 6.11: https://github.com/racket/drracket/issues/161