syntax of commenting (was: Re: [plt-scheme] Student parsing problem)

From: John Clements (clements at brinckerhoff.org)
Date: Wed Jun 3 14:52:59 EDT 2009

On Jun 3, 2009, at 11:41 AM, Eli Barzilay wrote:

> On Jun  3, John Clements wrote:
>>
>> Thinking about this more, I think what I'd like more than stacked
>> #:#: would just be a parenthesized comment-out form, e.g.:
>>
>> (COMMENT
>> (big
>>  sexpression
>>  one)
>>
>> (big
>>  sexpression
>>  two))
>>
>> You could pretty much get what you want by just defining a macro
>> that discards its argument, though I'm sure there would be
>> situations where this wouldn't behave the same as the reader
>> macro.
>
> Yes, there would be such situations -- many of them, and Scheme being
> Scheme, you don't get any way of doing this.  You could think about a
> macro system where some code expands to a `special-comment' value, and
> hook the macro expander to discard such values -- but that's a
> borderline confusion of the reader level and the macro level.  You
> could just the same imagine a macro system that allows expanding to a
> single double quote, forcing the expander to reparse the code... and
> at this point you need to stick your head just a little higher (or
> maybe lower, depending on your POV) and you'll be able to see that
> you're almost in TeX world.

I think you're misunderstanding me; what I'm pointing out is that for  
a COMMENT form to work correctly, it would have to be a reader form-- 
like #; , and like #| |#--and not a macro.  It just happens to be a  
reader form that our textual editors can already handle conveniently.

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/users/archive/attachments/20090603/a1aaba97/attachment.p7s>

Posted on the users mailing list.