>From the docs for scribble/base:
 

> The scribble/base 
> <https://docs.racket-lang.org/scribble/base.html?q=scribble%2Fbase> language 
> provides functions and forms that can be used from code written either in 
> Racket or with @ expressions. It essentially extends racket/base 
> <https://docs.racket-lang.org/reference/index.html>, except that 
> top-level forms within a module using the scribble/base 
> <https://docs.racket-lang.org/scribble/base.html?q=scribble%2Fbase> language 
> are treated as document content (like scribble/doclang 
> <https://docs.racket-lang.org/scribble/doclang.html?q=scribble%2Fbase#%28mod-path._scribble%2Fdoclang%29>
> ).


It sounds like it might be doing something special with top-level forms. 
The docs for scribble/doclang say this:

The first three elements in the #%module-begin 
> <https://docs.racket-lang.org/reference/module.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._~23~25module-begin%29%29>’s
>  
> body must be the id, post-process, and exprs arguments.


Expanding your example with the macro stepper, witht "Macro hiding:" 
Disable, ends up with:

(module anonymous-module scribble/base/lang
>   (#%module-begin
>    (⋯)
>    (define-values (foo) (begin (#%app printf (quote "two")) (quote 
> "three")))
>    (⋯)
>    (define-values (doc)
>      (#%app values (#%app idY184 lifted.0 (#%app list
>                                                  (quote "\n")
>                                                  (#%app:18 
> check-pre-part:19
>                                                            (#%app:20 
> printf (quote "one"))
>                                                           
>  (quote-syntax:19 loc:19))
>                                                  (quote "\n")
>                                                  (#%app:21 
> check-pre-part:22
>                                                            (#%app:23 
> printf foo)
>                                                           
>  (quote-syntax:22 loc:22))
>                                                  (quote "\n")))))
>    (#%provide:24 doc)))


So what it's doing is gathering all top-level definitions and moving them 
before the top-level expressions, to then define the document as a 
combination of the expressions. 

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to