c
2020-5-1 23:08:38

I am having a bad time with Scribble and racketblock


c
2020-5-1 23:09:15

I can follow the code sample for codeblock @codeblock\|{ #lang scribble/manual @codeblock{ #lang scribble/manual @title{Hello} } }\|


c
2020-5-1 23:09:53

But if I change that to racketblock Scribble outputs all my code as literal text


c
2020-5-1 23:10:03

@racketblock\|{ #lang racket/base (require web-server/servlet-env web-server/http web-server/dispatchers/dispatch) (serve/servlet (lambda (_) (next-dispatcher)) #:servlet-path "/" #:extra-files-paths (list (build-path "./static")) #:port 8080 #:launch-browser? #t) }\|


c
2020-5-1 23:10:36

renders as


sorawee
2020-5-1 23:11:00

You should use @racketblock[ ... ], not @racketblock\|{ ... }\|


c
2020-5-1 23:16:12

index.scrbl:36:0: read-syntax: unexpected `]`


c
2020-5-1 23:16:15

:confused:


c
2020-5-1 23:16:47

I’m using #lang scribble/manual in case that matters


c
2020-5-1 23:22:55

do I need some special indentation or something?


samdphillips
2020-5-1 23:26:20

It sounds like you have unbalanced parens or curlys or braces.


c
2020-5-1 23:40:18

#lang scribble/manual @racketblock[ #lang racket/base ]


c
2020-5-1 23:41:00

this is a minimum and it still doesn’t work :confused:


c
2020-5-1 23:41:04

bar.scrbl:5:0: read-syntax: unexpected `]` context...: read-undotted read-syntax


c
2020-5-1 23:41:08

(I snipped the rest)


alexknauth
2020-5-1 23:42:12

I don’t think racketblock is meant to have #lang within it. racketmod might be closer to what you’re looking for if you want #lang there


c
2020-5-1 23:46:01

that did it


c
2020-5-1 23:46:16

that was non-obvious! :smile:


jcoo092
2020-5-2 03:00:24

Thanks @samth & @badkins. Very helpful! :slightly_smiling_face:

Definitely sounds like places are the way to go for my purposes, then.

If you’re interested in a little more context of the end-goal, essentially I’m wanting to do something a bit like https://github.com/jcoo092/stereo-matching-practice/blob/master/fsharp/BeliefPropagation.fs using an approach similar to https://github.com/jcoo092/ivcnz2018/blob/master/CML/Program.fs (it would be fair to say that using that approach for the latter was unsuccesful - it was at least 20x slower than a simple naive implementation of the same thing. I expected it to be slower in this instance, but not that much slower - plus the program was much more bloated)