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

Re: Formal spec; implementation; nesting



(sorry for my delayed response)

> From: Alpert Herb Petrofsky <al@xxxxxxxxxxxxx>
>> Date: Mon, 10 Jan 2005 17:14:56 -0500
>> From: Paul Schlie <schlie@xxxxxxxxxxx>
>> 
>> So in summary, it would seem that all reader actions invoked by a reader
>> transform token should apply to the following correspondingly processed
>> <s-exp>, implying: (showing only reader actions)
>> 
>>  (' ' <s-exp>) :: ({quote {quote <s-exp>}}) => ((quote (quote <s-exp>)))
>> 
>>  (#; #; <s-exp>) :: ({remove {remove <s-exp>}}) => ()
>> 
>>  (#; ' <s-exp>) :: ({remove {quote <s-exp>}}) => ()
>>  
>>  (' #; <s-exp>) :: ({quote {remove <s-exp>}}) => (') ; error, unbound 'quote
> 
> Would you agree that these should be equivalent?:
> 
>    (' #; a b)
>    ('      b)

- no, just as I wouldn't expect (as it would be wrong):

  (' ' a b) :: ({quote '} a b) => (' b c) :: ({quote b} c) => ((quote b) c)

As clearly to be consistent with the present scope of the 'quote semantic
action applied by the reader, a reader semantic action must be applied to
its following correspondingly processed <s-exp> (right recursive), not prior
to it, yielding:

  (' ' a b) :: ({quote {quote a}} b) => ((quote (quote a)) b)

Therefore by analogy: [presuming (') => <nothing>, as opposed to an error]

  (' #; a b) :: ({quote {remove a}}) => (b)

> How about these?:
> 
>    (#; #; a b)
>    (#;      b)

- as above.

> I think what you're missing in your comparison of ' and #; is this:
> 
> ' consumes one sexp and produces one sexp.  The resulting sexp can
> then be used as the argument of another '.  In contrast, #; consumes
> one sexp and produces zero sexps.  The resulting nothingness cannot be
> used as the argument to another #; because nothing is not a sexp.

- I simply argue that the scope of the action is determined prior to
  the semantic action, not following it; therefore the outer remove ends
  up being applied to the <s-exp> which has already been removed by it's
  preceding reader semantic action, (just as expression arguments are
  first evaluated prior to the expression/function itself; but after
  the expressions scope and arguments were previously determined.)

Do you really see value in advocating:

(#; #; a #; b c d #; e f) :: ({rem a} {rem b} {rem c} d {rem e} f)

Being more useful than error prone (or simply nasty)?

To me unfortunately, it would seem to be a big mistake.