[E-Lang] Immutable map operations
Dean Tribble
tribble@e-dean.com
Thu, 29 Mar 2001 23:23:17 -0800
I have a very similar reaction to the |[] syntax. It's all very
principled, but when I step back, I can't imagine using it. Thank you for
articulating why :-)
> > > str |= [ 'a' ]
> > >
>...
>Its the extra set of brackets that bother me.
>
>All I wanted to do was add a single element to the collection. This ...
>
>The "| []" operator also reads like I am creating a new set and
>computing the union. That may very well be a compatible interpretation
>of the operation, but it's not the one I am thinking about when I want
>to insert a single element.
This last point is extremely important, and hadn't been called out
before. This has been the real source of my discomfort with the
solution. Adding a single element is so basic that any distance from that
is dissonant.
>The combination of two operators "|" and "[]" suggest that there are
>two operations being done on this line of code and neither of them
>immediately seem to have anything to do with "insert a single
>element".
[I elided the question for MarkM about what the syntax means for a
collection multiple arguments because there are several plausible answers,
and I don't think they change the tenor of the proposal]