1. Re: we need official libs : Swap
> (One might suggest that theoretically we should be able to close our eyes
to
> the implementation, but that's just not possible with this
construct--which
> says something by itself. There's no way of knowing how
>
> {s[i], s[j]} = my_func ()
>
> evaluates when i=j without knowing how it's implemented.)
I'm getting tired. But what's wrong the above code ?
Its an example how _not_ to use such a features.
Personally, I think the above should be legal, and (and only in such cases)
when 'collision' such as this is the case, only then, should it be handled
as if it was written out. (in which case, the second element gets assigned
to s[j] just as when you would have written this out:
temp = my_func ()
s[i] = temp[1]
s[j] = temp[2]
I don't know when you would want to do this, but if you want to, even with
the new syntax it would work as expected.
But make illegal, I don't care. I'm not planning on slicing and
concationating.
The point is, your examples are interesting, and you've proven that you can
know how to code confusingly .. but why ? but that's really you choice isn't
it ?
Ralf N.
nieuwen@