<div dir="ltr">I'm new to Scribble and I'm running into some problems splitting my literate program across multiple files.<div><br></div><div>The documentation says an rkt file with a "#lang scribble/lp" can be required from another Racket program like any other rkt file. That works fine, but requiring one scribble/lp from another doesn't seem to work. In particular, functions defined in the dependent scribble/lp aren't available to @chunks in the referencing scribble/lp, even when they're explicitly exposed via (provide ...).</div><div><br></div><div>To clarify, here's an example involving a few files placed in the same directory.</div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><br></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">;; FILE: main.scrbl<br>#lang scribble/base<br>@require[scribble/lp-include]<br>@lp-include["prelude.rkt"]<br>@lp-include["chapter1.rkt"]<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">;; FILE: prelude.rkt<br>#lang scribble/lp<br>@chunk[<prelude><br>(provide atom?)<br>(define atom?<br>  (lambda (x)<br>    (and (not (pair? x)) (not (null? x)))))]<br><br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">;; FILE: chapter1.rkt (fails to access the Prelude's definition of "atom?")<br>#lang scribble/lp<br>@require["prelude.rkt"]<br>@chunk[<atom?-test><br>(define atom-test (atom? 1))]<br><br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">;; FILE: prelude-lib-test.rkt (successfully accesses "atom?")<br>#lang racket<br>(require "prelude.rkt")<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">(define atom-test (atom? 1))</blockquote><br></div><div>In prelude-lib-test.rkt atom-test evaluates to #t as expected. However, when I try to evaluate atom-test from chapter1.rkt I'm met with this error:</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">atom-test: undefined;<br> cannot reference an identifier before its definition</blockquote><div><br></div><div>Is there something else I should try, or is requiring LPs from LPs like this not currently supported?</div></div><div><br></div><div>Cheers,</div><div>Jake</div></div>