Re: how useful are collecting lists? Alan Manuel Gloria 14 Mar 2013 04:58 UTC

On 3/14/13, David A. Wheeler <xxxxxx@dwheeler.com> wrote:
> David Vanderson:
>> My plan was to replace "<* begin" with ". <*" in the example, so this:
>>
>> define-library
>>    example grid
>>    export make rows cols ref each rename(put! set!)
>>    import scheme(base)
>>    <* begin
>> ;stuff
>> *>
>>
>> becomes (in a scheme with implicit begin):
>> define-library
>>    example grid
>>    export make rows cols ref each rename(put! set!)
>>    import scheme(base)
>>    . <*
>> ;stuff
>> *>
>>
>> Does this run against your current "head" rule?
>
> It does, but even if I modified head I would not expect it
> to do what you want. A ". x" by itself returns just "x" in other cases,
> so for consistency, adding a rule about "." in head would
> still create an additional (...).
>
> But that's okay, because I think what you want is:
> define-library
> !  example grid
> !  export make rows cols ref each rename(put! set!)
> !  import scheme(base)
> !  .
> ! <*
> ! ;stuff
> *>
>

To help clarify this, please consider:

a b c d

===>

a
! b
! c
! d

By symmetry:

a b . d
===>
a
! b
! .
! d

And so:

a b . (x y)
===>
a
! b
! .
! (x y)

And since:

<*
x
y
*>
<==>
(
x
y
)

Then:

a b . (
x
y
)
===>
a
! b
! .
! (
x
y
)
===>
a
! b
! .
! <*
x
y
*>

Which is also equivalent to:

a b . <*
x
y
*>

> Or, just:
> define-library . <*
> example grid
> export make rows cols ref each rename(put! set!)
> import scheme(base)
> ;stuff
> *>
>
>
>
> If constructs like this are common:
> !  .
> ! <*
> ...
> *>
>
> Then we could argue that "\\" after "." is reasonable, e.g.:
> !  . \\ <*
> ...
> *>
>
> However, I do worry that the sequence ". \\ <*" completely fails
> the "it's obvious what it means" test.
>
>> Definitely working out well for me so far.  I'm only sorry that I didn't
>> hear about it earlier - my first notice came from your post to the
>> Racket dev list a week or so ago.
>
> No problem!  I'm really glad you've joined us!
>
> --- David A. Wheeler
>
>