[plt-dev] scribble/comment-reader doc change?

From: John Clements (clements at brinckerhoff.org)
Date: Tue Apr 14 16:32:21 EDT 2009

I struggled for a while with the new scribble/comment-reader form  
before discovering an important unstated constraint: it appears that  
the column-counting is off-by-one in the new reader's body. This means  
that putting code right up against the left edge results in errors,  
because the source position has a negative number in the column count.

In particular, consider this example:

#lang scribble/doc

@(require scribble/manual)

@#reader scribble/comment-reader
(schemeblock
  ;; This is not a pipe
  (make-pipe)
)

Evaluating this signals this error:

Module Language: invalid module text
datum->syntax: expects type <syntax, source location vector or list,  
or #f> as 3rd argument, given: #(#<path:/private/tmp/foo.scrbl> 6 -1  
81 51); other arguments were: #f (#<syntax:/private/tmp/foo.scrbl:6:1>  
#<syntax:/private/tmp/foo.scrbl:7:1> #<syn... #<syntax::1>


I suggest either changing this behavior or adding a paragraph such as  
this to the docs:

Finally, note that the column indexes in the block governed by the new  
reader are considered relative to the # in the leading line, and  
therefore that placing text in the leftmost column of the editor will  
result in column indices of -1 (and lead to errors).

No?

John

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2484 bytes
Desc: not available
URL: <http://lists.racket-lang.org/dev/archive/attachments/20090414/38811abf/attachment.p7s>

Posted on the dev mailing list.