Am 11.06.2014 12:09, schrieb Artur T.:
Am 11.06.2014 01:27, schrieb Allin Cottrell:
> On Tue, 10 Jun 2014, Riccardo (Jack) Lucchetti wrote:
>
>> Or, alternatively,
>>
>> <hansl>
>> function matrix deselected (list L1, list L2)
>> matrix m1 = L1
>> matrix m2 = L2
>> return !sumc(m1 .= m2')
>> end function
>> </hansl>
>
> Now that's truly wicked ;-)
>
> Allin
>
Indeed!
Artur
_______________________________________________
Jack's ideas are always impressive, although I must say I like his
second suggestion with the list difference much better, it's directly
readable.
Apart from that, the expression:
"!sumc(m1 .= m2')"
puzzles me a little. First because of the transpose in "(m1 .= m2')": if
it is equivalent to "((m1 .= m2)')" I would say I find the order of
precedence surprising. If instead it's the same as "(m1 .= (m2'))" then
I guess I don't understand what the code does.
And secondly, using boolean stuff like "!" on vectors/matrices is always
a little ambiguous: one could interpret it as element-wise (as is done
here AFAICS), or in terms of "is there *any* non-zero element in there",
returning a single 1/0 (TRUE/FALSE) instead of a matrix of ones/zeros.
This is a design decision, is it settled and/or documented yet?
Thanks,
sven