> From: Oleg Kobchenko <[EMAIL PROTECTED]>
>
> > From: "Sherlock, Ric"
> >
> > > Was there anything wrong with my definition for join?
> > > join=: [EMAIL PROTECTED] }. [:;,L:0
> >
> > It's nice and simple,
> > join03=: [EMAIL PROTECTED] }. [:;,&.>
> > Is perhaps slightly clearer and a little faster, but doesn't handle left
> > args
> of
> > length >1.
> > join04 / join05 seem to have the best combination of performance and
> > features,
> > but are not as simple or easy to understand.
> >
> > join04=: ' '&$. :(4 : '(;@(#^:_1!.(
>
> Here's one that is similar in time and space to 04 and 05,
> but is very simple to understand.
>
> join08=: [EMAIL PROTECTED] }. [EMAIL PROTECTED] ;@,. ]
>
> 20 ts 'a join08 c'
> 0.0295858 1.98349e6
>
> 20 ts 'a join05 c'
> 0.0272022 1.83859e6
In fact, in view of [EMAIL PROTECTED] boxopen doesn't make sense, so yet
simpler:
join08=: [EMAIL PROTECTED] }. <@[ ;@,. ]
To Raul: join02 works fine. In fact its latter part is used here.
Version 08 now replaces Phrases/Strings in Wiki. For the record,
it was essentially:
join09=: [EMAIL PROTECTED] ;@}.@,@,. ]
20 ts 'a join09 c'
0.0586669 4.89997e6
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm