Hey Pascal,
I would guess that there are more elegant ways to approach this, but this is what I came up with.
s1=: 0:`]@.(*@#) NB. test for no items
s2=: 0:`]@.(0 -.@e. $) NB. test for empty array
s1 i. 2 3
0 1 2
3 4 5
s2 i. 2 3
0 1 2
3 4 5
s1 i. 0
0
s2 i. 0
0
s1 3 0 $ 5 NB. returns arg if it has items
s2 3 0 $ 5 NB. returns 0 if array is empty
0
Cheers, bob
> To unsubscribe from this group and stop receiving emails from it, send an email to
forum+un...@jsoftware.com.
>