<div dir="ltr">No, that doesn't work for me either. Anyway, I was hoping I could export f and then run the examples in a second file (because we have to lp-include the literate program anyway):<div><br></div><div><font face="monospace">;; lp.scrbl</font></div><div><div><font face="monospace">#lang scribble/manual</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">@require[scribble/lp-include]</font></div><div><font face="monospace">@require[scribble/eval]</font></div><div><font face="monospace">@lp-include["example.rkt"]<br></font></div></div><div><font face="monospace">@examples[(f 10)]</font></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 14, 2014 at 4:59 PM, Joel McCracken <span dir="ltr"><<a href="mailto:mccracken.joel@gmail.com" target="_blank">mccracken.joel@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have tried a few different things. In you case, I think adding a:<br>
<br>
    @chunk[ <foo> (provide f)]<br>
<br>
... will make lp-test work.<br>
<br>
I'm still can't get lp.rkt to become self-referential, though.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On Sun, Dec 14, 2014 at 4:46 PM, Benjamin Greenman <<a href="mailto:blg59@cornell.edu">blg59@cornell.edu</a>> wrote:<br>
> I tried and failed to figure this out. In particular, when I create the<br>
> example "lp.rkt" file described at the top of the scribble/lp docs and<br>
> require it "in the normal manner", the identifier f is unbound for me.<br>
><br>
> The code I'm using is pasted below:<br>
><br>
> ;; lp.rkt<br>
> #lang scribble/lp<br>
><br>
> Literate programs have chunks of code, like this one:<br>
><br>
> @chunk[<f><br>
>        (define (f x)<br>
>          <fs-body>)]<br>
><br>
> and this one:<br>
><br>
> @chunk[<fs-body><br>
>        (* x x)]<br>
><br>
> that, when assembled, produce a complete program, in this case:<br>
><br>
> @racketblock[(define (f x)<br>
>                (* x x))]<br>
><br>
> -----<br>
><br>
> ;; lp-test.rkt<br>
> #lang racket<br>
> (require "lp.rkt")<br>
> (f 3) ;; Error!<br>
><br>
><br>
><br>
> On Sun, Dec 14, 2014 at 2:24 AM, Joel McCracken <<a href="mailto:mccracken.joel@gmail.com">mccracken.joel@gmail.com</a>><br>
> wrote:<br>
>><br>
>> I'm trying to create a document that includes code, describes that<br>
>> code, includes example usage, and exports some of the bindings so that<br>
>> it may be included later.<br>
>><br>
>> I've been looking at the scribble documentation, and it seems like all<br>
>> this should be possible. I can't seem to figure out how to actually<br>
>> run examples. Here's what I have:<br>
>><br>
>> #lang scribble/lp<br>
>><br>
>> @(require scribble/eval)<br>
>><br>
>> This would be a wonderful way to accomplish things!<br>
>><br>
>> @chunk[*<br>
>>         (define (f x)<br>
>>           <f-body>)]<br>
>><br>
>> @chunk[<f-body><br>
>>         (* x x)]<br>
>><br>
>><br>
>> And then, I could show an example:<br>
>><br>
>> @examples[<br>
>>         (f 10)<br>
>> ]<br>
>><br>
>><br>
>> Any advice would be really appreciated.<br>
>> ____________________<br>
>>   Racket Users list:<br>
>>   <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</div></div></blockquote></div></div>