Re: [pure-lang-users] Proposed syntax changes
Status: Beta
Brought to you by:
agraef
From: Libor S. <li...@gm...> - 2008-08-15 11:48:04
|
On Fri, 15 Aug 2008 02:16:40 +0100, Albert Graef <Dr....@t-...> wrote: > Libor Spacek wrote: >> I am not entirely convinced that the tuples are even worth having at all. >> For the minimal (flatness) distinction, they ship in a lot of confusion. > > Can you elaborate on that? The only complication I see is the borked > list-of-tuples syntax, and I'm about to fix that (hopefully!). > Both lists and tuples are devices for ordering and grouping some items. I do not see the problem with using a pair of brackets to make the grouping explicit, as in the list [1,2,3] instead of relying on the precendence of the associativity and using a tuple 1,2,3. I have learnt through painful experience not to rely on remembering the exact precedence of numerous associative operators, especially when I can add my own. Maybe it is just me but when using Pure, I am always worrying: 'is this a tuple or is it a list?' I need to worry about it because selectors and functions will typically work only on one but not on the other. To give a trivial example: head (1..3); // is OK head (1,2,3); // is not OK So, if I return 1,2,3 instead of [1,2,3], everything falls down round my ears. I guess you will say that I ought to know better and you will be right. To complicate things further, I can also in many situations use simply 1 2 3, e.g. >let a = 1 2 3; >a; 1 2 3 So there are three ways of ordering and grouping items which are nearly the same but not quite, which I, at least, find a little bewildering. L. |