[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nested comments (please correct lexical scope)

> Sorry, I mashed three ideas together there:
> 1. I don't think it's a good idea for (#;#;a b c) => (c).

- fully agree, obviously :)

> 2. I would prefer (#;#;a b c) => (b c), analogous to (''a b c).

- as above, implying to me something along the line of:
  (#;#;a b c) :: ({remove {remove a}} b c) => (b c).

> 3. I don't like the suggestion that (#; a) => (a) because of the space.

- only suggested it as although many scheme readers seem to accept:

  '<ws><s-exp> :: {quote a} => (quote <s-exp>)

  r5rs seems to imply in all examples, no <white-space> being allowed
  between the quote abbreviation and it's target <s-exp>; which makes
  sense to me as it visually and lexically binds the reader action with
  it's target <s-exp>, as opposed to allowing something like:

  (+ a b '; some comment
     (- c d))  :: (+ a b {quote (- c d)}) => (+ a b (quote (- c d)))

  or analogously:

  (+ a b #;; some comment
     (- c d))  :: (+ a b {remove (- c d)}) => (+ a b)

  as opposed to requiring no <ws>:

  (+ a b #;; some comment
     (- c d)) :: (+ a b {remove } (- c d)) => (+ a b (- c d))


  (+ a b ; some comment
     #;(- c d)) :: (+ a b {remove (- c d)}) => (+ a b)

  which overall seems like a good thing to enforce?

> To defend my #1: While I understand the "comment out next sexp"
> explanation, my mind sees "A" as the next sexp for /both/ comment tokens
> in (#;#;a b c), thus making it equivalent to (#;a b c) => (b c).