pavpanchekha
2021-8-6 13:47:09

Ok.


massung
2021-8-6 13:52:09

Can someone point me to an example (Scribble) of a @defproc returning multiple values? I have:

@defproc[(shape [thing type]) integer? integer?]{...} And that fails because the result is too many values. I’m not sure how to get that to work?



sorawee
2021-8-6 13:54:42

(values integer? integer?) is what you want.


mflatt
2021-8-6 13:54:50

Use (values integer? integer?) . I don’t see that it’s documented anywhere, so I’ll make a note to fix that.


massung
2021-8-6 13:57:23

thanks!


massung
2021-8-6 16:39:43

Another scribble question: is there a way to have comments show up in a @racketblock[]?



massung
2021-8-6 16:47:27

ty sir


soegaard2
2021-8-6 17:10:29

Apropos Scribble.

In the documentation for Sketching, I like to show both the code and the resulting image using the examples form. I found this way to do it:

@examples[#:label #f #:eval se (stroke 204 102 0) (eval:alts (rect 15 20 70 60) (begin (rect 15 20 70 60) (send dc get-bitmap)))] Is there a way that’s doesn’t require me to repeat the last expression twice?


ben.knoble
2021-8-6 17:17:45

on topic of docs, raco docs <word> has kind of stopped working for me: it opens file:///Users/Knoble/Library/Racket/8.0/doc/search/index.html?q=define-values (this was with raco docs define-values), but it’s just a blank page. Used to work fine. Did I run a raco command and bork something?


soegaard2
2021-8-6 17:19:47

Does file:///Users/Knoble/Library/Racket/8.0/doc/search/index.html otherwise look fine?


samth
2021-8-6 17:31:52

Can you make the result pict-convertible?


soegaard2
2021-8-6 17:39:26

A little more context.

Before each example, I make a blank bitmap and set the parameter current-dc.

@examples[#:hidden #:eval se (current-dc (new-bitmap-dc 100 100)) <some default settings go here>] Then commands like stroke and rect draw on the drawing context in dc.

In the example I’d like the result on the screen to be:

(stroke 204 102 0) (rect 15 20 70 60) <the resulting bitmap> That is, I want the result of `(send dc-bitmap) (the bitmap shows up fine in the output) to be shown but not the command itself. The only Scribble construct I could find, that were close were(eval:alts …). Buteval:alts` always shows the first alternative.


soegaard2
2021-8-6 17:40:54

That is a roundabout way of saying, I’d like to write: @examples[#:label #f #:eval se (stroke 204 102 0) (rect 15 20 70 60) (eval:show-result (send dc get-bitmap))]


ben.knoble
2021-8-6 17:49:21

The contents are @soegaard2 &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<http://www.w3.org/TR/html4/loose.dtd>"&gt; and that’s it


ben.knoble
2021-8-6 17:49:30

I have no idea how this happened though


ben.knoble
2021-8-6 17:49:54

I was working on a new local package and it’s possible I inadvertently ran some odd command…


soegaard2
2021-8-6 17:50:59

Maybe raco setup can fix it?


samdphillips
2021-8-6 18:09:44

raco setup --doc-index I think. That happens to me every few months and I can never remember how to fix.


ben.knoble
2021-8-6 19:11:07

Beautiful, thanks Sam!


ben.knoble
2021-8-6 19:12:13

That went on my list of “problems I spent too much time solving” so I won’t forget


pavpanchekha
2021-8-6 22:02:06

@samth another raco make question for you (thread)


pavpanchekha
2021-8-6 22:02:37

~/herbie $ raco make src/herbie.rkt ~/herbie $ racket src/herbie.rkt report /tmp/test.fpcore /tmp/out &lt;runs for a while&gt; instantiate-linklet: mismatch; reference to a variable that is not exported; possibly, bytecode file needs re-compile because dependencies changed name: get-parametric-operator13.1 exporting instance: "/Users/pavpan/herbie/src/syntax/syntax.rkt" importing instance: "/Users/pavpan/herbie/src/web/plot.rkt" context...: body of "/Users/pavpan/herbie/src/web/plot.rkt" .../racket/lazy-require.rkt:89:13: get-sym /Applications/Racket v8.2/collects/racket/promise.rkt:65:10 /Applications/Racket v8.2/collects/racket/promise.rkt:45:2 /Applications/Racket v8.2/collects/racket/lazy-require.rkt:109:6 body of (submod "/Users/pavpan/herbie/src/herbie.rkt" main) ~/herbie $ raco make src/web/plot.rkt ~/herbie $ racket src/herbie.rkt report /tmp/test.fpcore /tmp/out &lt;works&gt;


pavpanchekha
2021-8-6 22:02:52

Here it seems like lazy-require isn’t properly signaling to raco make somehow


samth
2021-8-6 22:54:43

I think that’s related to what we discussed recently


samth
2021-8-6 22:54:59

And I should be able to finish that PR soon


pavpanchekha
2021-8-7 02:43:56

Got it