Ric wrote:
> 20 ts 'isAllSame0 f'
> 0.00212922717994 1049728
> 20 ts 'isAllSame1 f'
> 0.000538559346748 33920
> 20 ts 'isAllSame2 f'
> 0.00608321959755 1082944
This surprised me, until I remembered that your phrase -:"r is supported
by special code.
> isAllSame2=: 1 = #...@~.
Ah, one must be careful with constants, even the special constants 0 and
1 . Note that allSame2 doesn't agree with the other formulations on
zero-item arrays:
(isAllSame0, isAllSame1, isAllSame2) ''
1 1 0
Though I guess you could say (2 > #...@~.) .
-Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm