perry.houchens
2022-5-17 10:03:43

@perry.houchens has joined the channel


ben
2022-5-17 14:41:44

How to typeset a module example that ends in an error? I’ve been trying scribble/example but it seems like it’ll either do a module or an error — not both.

This is the closest module-looking thing I’ve got: #lang scribble/manual @(require scribble/example) @title{Sample} @examples[#:eval (make-base-eval) #:no-prompt #:no-inset (code:comment "#lang racket/base") (define x 42) (eval:error (string-length x)) ]


soegaard2
2022-5-17 14:47:00

The form examples has a #:lang option.


ben
2022-5-17 14:48:29

The lang option disables (eval:error ...)

but, I just realized, #:lang also ignores indentation. So I’ll probably keep what I have.


soegaard2
2022-5-17 14:50:08

Oh. I see what you mean. Do you think it is intentional, that eval:error is disabled?


ben
2022-5-17 14:55:15

It seems strange, but also old. Maybe there was never a need to implement eval:error for modules.


soegaard2
2022-5-17 14:56:55

soegaard2
2022-5-17 14:58:23

When the #:lang option is present, examples use racketmod+eval.

[(attribute module-name) (syntax/loc stx (racketmod+eval #:eval eval #:escape escape module-name form ...))]


soegaard2
2022-5-17 14:59:35

The problem is the "+eval" :slightly_smiling_face:


soegaard2
2022-5-17 15:02:55

Here is the definition of racketmod+eval: (define-syntax racketmod+eval (syntax-rules () [(_ #:eval ev #:escape unsyntax-id name e ...) (let ([eva ev]) (#%expression (begin (interaction-eval #:eval eva e ...) (racketmod #:escape unsyntax-id name e ...))))] [(_ #:eval ev name e ...) (racketmod+eval #:eval ev #:escape unsyntax name e ...)] [(_ #:escape unsyntax-id name e ...) (racketmod+eval #:eval (make-base-eval) #:escape unsyntax-id name e ...)] [(_ name e ...) (racketmod+eval #:eval (make-base-eval) #:escape unsyntax name e ...)])) ```Maybe a variant that uses (interaction #:no-errors? #t #:eval eva e ...) is the answer?```


soegaard2
2022-5-17 15:03:30

Or use interaction and rackemod directly.


sorawee
2022-5-17 15:03:41

it’s turtles all the way down


sorawee
2022-5-17 15:04:06

turtles = macros confirmed


samth
2022-5-17 15:22:27

@popa.bogdanp This test failure https://pkg-build.racket-lang.org/server/built/test-fail/dbg-ui.txt is because the test submodule in dbg-ui/ui/reference-graph.rkt launches a window and doesn’t close it. It seems like it might make sense for that to be the main module instead.


soegaard2
2022-5-17 15:35:24

@ben This is pretty close: #lang scribble/manual @(require scribble/example (only-in scribble/eval interaction/no-prompt)) @title{Sample} @(define ev (make-base-eval)) @(begin (racketmod #:escape code:error racket/base (define x 42)) (interaction/no-prompt #:eval ev #:no-errors? #t (eval:error (string-length x))))


ben
2022-5-17 15:36:17

:+1: much better!


soegaard2
2022-5-17 15:36:50

I am not sure how to get rid of the extra indentation of (string-length x).


soegaard2
2022-5-17 15:37:40

Oh! The error is wrong now.


soegaard2
2022-5-17 15:39:36

@(begin (racketmod #:escape code:error racket/base (define x 42)) (interaction-eval #:eval ev (define x 42)) (interaction/no-prompt #:eval ev #:no-errors? #t (eval:error (string-length x))))


ben
2022-5-17 15:48:36

(interaction/no-prompt #:eval ev (string-length x)) gets rid of the indentation (I wonder if that’s a bug in eval:error … ignoring the no-prompt setting)


soegaard2
2022-5-17 15:57:05

I think so. Not in the datum eval:error though, but in interaction/no-prompt.


popa.bogdanp
2022-5-17 16:17:49

Thanks! Fixed.


samth
2022-5-17 21:11:50

@pavpanchekha can I encourage you to restructure egg-herbie-{windows,linux,osx} so that they don’t conflict on the pkg-build?


pavpanchekha
2022-5-17 23:42:17

Hi Sam, we’d love to. Would you be willing to do a meeting with the Herbie devs to tell us how to do it better? We’re in the middle of wanting to change this up.