<p>I've never gotten into anything but trivial syntax operations. I'd be happy to dig further if anyone can get me started on stepping though expansions of included files. Sounds like a good learning opportunity.<br>
</p>
<div class="gmail_quote">On Apr 22, 2012 3:34 PM, "Matthias Felleisen" <<a href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I haven't used /lp myself. I am stuck here -- Matthias<br>
<br>
<br>
<br>
On Apr 22, 2012, at 12:25 AM, Deren Dohoda wrote:<br>
<br>
> Hi Matthias,<br>
><br>
> I cannot seem to get it to work. I can get scribble to be happy, but<br>
> not the scribble/lp file.<br>
><br>
> First try: (somewhere in the middle of the file)<br>
> @(begin<br>
> #reader scribble/comment-reader<br>
> (chunk <hs-from-xs><br>
> (define hs ; (xi+1) - xi<br>
> (map - (rest xs) (drop-right xs 1)))))<br>
> Second try:<br>
> @chunk[<hs-from-xs><br>
> #reader scribble/comment-reader<br>
> (define hs ; (xi+1) - xi<br>
> (map - (rest xs) (drop-right xs 1)))]<br>
><br>
> Both can be scribbled with the comment when included with (lp-include<br>
> ...), but doesn't run when one runs the file itself. When the file is<br>
> run, this error appears: "bad syntax (multiple expressions after<br>
> identifier) in: (define hs (code:comment ..." The only place I can<br>
> find code:comment defined is in<br>
> "...Racket/collects/scribble/lp/lang/lang.rkt":<br>
> (provide code:comment)<br>
> (define-syntax (code:comment stx)<br>
> (if (eq? (syntax-local-context) 'expression)<br>
> (syntax (void))<br>
> (syntax (define (f x) x))))<br>
><br>
> It looks like it was supposed to strip the comment when being run.<br>
> "...Racket/collects/scribble/comment-reader.rkt" does have<br>
><br>
> (define (do-comment port recur)<br>
> (let loop ()<br>
> (when (equal? #\; (peek-char port))<br>
> (read-char port)<br>
> (loop)))<br>
> (when (equal? #\space (peek-char port))<br>
> (read-char port))<br>
> `(code:comment<br>
> (unsyntax ...<br>
><br>
> So it seems like this is where code:comment is coming from, but for<br>
> some reason the code:comments rule from lang.rkt isn't seeing it.<br>
><br>
> Deren<br>
><br>
> On Sat, Apr 21, 2012 at 9:07 PM, Matthias Felleisen<br>
> <<a href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>> wrote:<br>
>><br>
>> Do you use<br>
>><br>
>> @;%<br>
>> @(begin<br>
>> #reader scribble/comment-reader<br>
>> (racketblock<br>
>> (place-image ROCKET X ... MTSCN)<br>
>> ))<br>
>> @;%<br>
>><br>
>> to write down code blocks? It installs a reader that can cope with comments.<br>
>><br>
>><br>
>><br>
>> On Apr 21, 2012, at 4:53 PM, Deren Dohoda wrote:<br>
>><br>
>>> I have finally started learning scribble for use in literate<br>
>>> programming to break away from noweb for Racket. It's quite excellent,<br>
>>> I am glad to be making the switch. Thank everyone for their work. I<br>
>>> miss the math of latex but it isn't a dealbreaker.<br>
>>><br>
>>> However, part of writing code is commenting the code for reminders of<br>
>>> why little bits are the way they are. The problem is that the scribble<br>
>>> HTML output has stripped all comments from the chunks. I have tried<br>
>>> digging down into scribble/lp but I must admit the guts are outside my<br>
>>> ability to understand. I'm guessing it is because the reader has<br>
>>> already stripped comments from the syntax by the time Racket gets to<br>
>>> the "chunk" syntax rule. The one bit that seems to indicate it strips<br>
>>> comments (code:comment) never seems to be used anywhere. I know that<br>
>>> there are code examples with comments in the Racket documentation. Is<br>
>>> there any way to keep code comments preserved in the scribbled view of<br>
>>> chunks?<br>
>>><br>
>>> Thanks,<br>
>>> Deren<br>
>>> ____________________<br>
>>> Racket Users list:<br>
>>> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
>><br>
<br>
</blockquote></div>