Yes, I just figured it out the same definition.

However, I was very surprised to see perm massively outperforms tap:

timespacex 'a=: perm 10'
0.3946 3.18771e8
   timespacex 'b=: (A.&:i.~ !) 10'
2.74118 5.62038e8
   a-:b
1

JVERSION
Engine: j901/j32/android
Release-e: commercial/2020-02-09T15:23:16
Library: 9.01.24
J Android: 1.4.08/7.1.2/25
Platform: Android 32 (armeabi-v7a)
Installer: unknown
InstallPath: /storage/emulated/0/Android/data/com.jsoftware.j.android/files
Contact: www.jsoftware.com


Perhaps an opportunity for performance improvement in dyadic A. ?

Best regards,

Jan-Pieter

On Mon, May 25, 2020, 22:59 'Mike Day' via Programming <
[email protected]> wrote:

> If I can’t remember the idiom, I look for “tap.”  My favourite form is
>       tap =:  A.&i.~ !
>
>    (perm-: tap)3. NB. Same results.....
> 1
>
> Cheers,
>
> Mike
> Sent from my iPad
>
> > On 25 May 2020, at 21:44, Skip Cave <[email protected]> wrote:
> >
> > perm
> >
> > 3 : 0
> >
> > z=. i.1 0
> >
> > for. i.y do. z=. ,/ (0 ,. 1 + z) {"2 1 \:"1 = i. 1 + {: $z end.
> >
> > :
> >
> > ,/ ({~ perm@#)"1 x comb y
> >
> > )
> >
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to