Re: why a new lexical form? bear 05 Jun 2002 19:15 UTC


On Wed, 5 Jun 2002, Al Petrofsky wrote:

>> From: bear <xxxxxx@sonic.net>
>>
>> Why do we actually need a new lexical form for comments?
>>
>> Can't we just use a syntax definition and say
>>
>> (Comment ...)
>>
>> "expands" to nothing?
>
>I sometimes use ' as a way to comment out multiline commands and
>definitions.
>
>However, it is more useful to be able to comment at the token level:
>
>  (define stuff
>    '(foo
>      bar
>  #| FIXME: These two cause crashes for some reason  -APP
>      baz
>      quux
>  |#
>      zork))
>
>-al

I'm not getting it.  How is this different from

   (define stuff
      '(foo
        bar
     (Comment FIXME: These two cause crashes for some reason -APP
        baz
        quux
     )
        zork))

I bring this up because anything that requires new tokens
to be recognized by the lexer is inherently nonportable.
It is either "there" or "not there" in a given system, and
there's not much you can do about it.

One thing that argues *against* my paren-delimited
alternative is the effects of autoindentation on it
potentially disrupting the cognitive flow of the
code.

			Bear