On 2/20/07, Raymond Toy <raymond.toy at ericsson.com> wrote:
>
> sol : linsolve_by_lu(foo)
> would assign the list to sol. But we could have
> [sol] : linsolve_by_lu(foo)
> just take the first element, and
> [sol, cnd] : linsolve_by_lu(foo)
>
As I guess everybody on the list knows by now, I always prefer it when the
language requires the user to make his/her intent explicit. I believe this
reduces users' confusion and increases reliability of code.
Destructuring assignment seems fine; on the other hand, I'm not comfortable
with silently ignoring extra elements. I would prefer something like
[sol,...] : linsolvexxx()
(It's easy enough to define infix("...") ) The main problem I have with
*this* in turn is the introduction of new special-purpose notation. But in
fact there are other cases where it might be useful, e.g. to indicate an
approximate continued fraction as opposed to an exact one: [1,2] denotes
3/2, while [1,2,...] denotes the interval [4/3,3/2] (i.e. the values of the
continued fraction [1,2,x] for 1<=x<=inf ). You'd think you could use it to
input taylor series, but you need more specific information (what variables,
what degree). So this is just thinking out loud for now....
-s