syntax of commenting (was: Re: [plt-scheme] Student parsing problem)
On Jun 3, 2009, at 12:04 PM, Eli Barzilay wrote:
> On Jun 3, John Clements wrote:
>>
>> 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.
>
> This only gets you deeper into the quicksand. What about:
I think I'm already over my head in quicksand, so there's no point in
stopping now.
> (parameterize ([read-case-sensitive #f])
> (read (open-input-string "(comment ...)")))
>
> or any of these:
>
> [COMMENT ...]
> (\COMMENT ...)
> #(COMMENT ...)
> (COMMENT...) for example (COMMENTARY ...)
>
> And I didn't even begin to talk about confusions like
>
>> (list-ref '(COMMENT 3) 0)
> list-ref: expects 2 arguments, given 1: 0
I suspect that most of these have naive solutions at the reader level
that work pretty well
BUT
I realize that there's really no need to add anything to the language,
because you can already have what I'm proposing (except for the
convenient swap-out) by using
#;(
(my
sexp
here)
(my
other
sexp))
... and in fact that's what I already do.
So, I guess my observation boils down to this: I think that
forbidding sequenced #;'s would not significantly impact the
expressiveness of the editor experience.
It _is_ an argument for the more widespread use of C-c C-e, though. :)
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/53fb9d44/attachment.p7s>