looks great, with a bit of struggling, I figured out how t works:

it adds padding to the x and/or y list such that they match in length.  You 
can't use it just to see if 'aa' matches 'aa  '

The reason it works extending the x side as a list instead of appending to a 
single string is:

  $ 0{. 'ac',:'dddd'
0 4

   $'ac' , 0{. 'ac  ',:'dd'
1 4




----- Original Message -----
From: Don Guinn <[email protected]>
To: Programming forum <[email protected]>
Cc: 
Sent: Sunday, October 27, 2013 9:54:04 AM
Subject: Re: [Jprogramming] a more useful i. ?

   t=:,0&{.

The above seems like a simpler way to reshape items of an array if
necessary. Then I becomes

   I=:(t i. t~) f.

If catenate (,) had special code to recognize that if one argument to
catenate had no items and the shape of it were such that the other argument
would not be changed and simply pass it on, then t should take very little
time and space if reshaping were unnecessary. But if the added time to
handle the special code for other forms of catinate were significant this
would not be a good idea.

​It seems to me that the expression t is simple enough that ​it could be
used with i. when needed instead of extending the definition of i. .

----------------------------------------------------------------------
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