[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: anonymous lists
Sorry -- I slipped back into rc notation which obviously caused some
confusion.
(a) I don't want heirarchical lists. (Well, I do but that wasn't what
I was suggesting.)
(b) Why are the following different? Why is a list treated one way on
the RHS of assignment, but instantly flattened in any other context?
; bar = (a b c d); foo bar
; foo (a b c d)
(c) Consequently, I want the following to behave differently:
; foo a b c d # pass 4 args: a, b, c, and d
; foo (a b c d) # pass 1 arg: the list (a b c d)
I only want lists to be flattened if I EXPLICITY ask for it with $. I
think this is both more useful and more consistent.
(d) I'm not sure if I want:
; foo $(a b c d)
to be the same as:
; foo 'a' 'b' 'c' 'd'
or:
; foo 'a b c d'
Perhaps we could introduce another flattening operator, so that $(a b
c d) returns 'a' 'b' 'c' 'd', and %(a b c d) returns 'a b c d'.
Notice the change in terminology: $ is now a flattening operator
rather than an evaluation operator, as it is the only way to flatten a
list (other than picking the elements out one by one).
(e) More radically, I would like to see `{...} return a list, for
example:
`{ echo a; echo b ; echo c ; echo d }
returns (a b c d), and needs to be explicitly flattened:
; echo `{ echo a; echo b ; echo c ; echo d }
('a' 'b' 'c' 'd')
; echo $`{ echo a; echo b ; echo c ; echo d }
a b c d
In summary, I'm suggesting making the primary data-type of es the list
rather than the string. No list should be flattened unless EXPLICITY
preceded by $ (or %).
Am I making myself any clearer, or is this still not making any sense?
Alan.