It cannot be gerund or noun, for some reason the
magic flat indices work only for verb argument:
setb=: 1 : '(I.,m)"_}'
'#' b setb a
----##--#
#-##-##--
###--####
#--#-#-#-
-####---#
(a.{~65+i.+/,b) b setb a
----AB--C
D-EF-GH--
IJK--LMNO
P--Q-R-S-
-TUVW---X
----- Original Message ----
From: Brian Schott <[EMAIL PROTECTED]>
To: Programming forum <[email protected]>
Sent: Friday, July 21, 2006 3:20:14 PM
Subject: Re: [Jprogramming] RE: }
Trying to generalize further, I run into a problem
because it seems that if a gerund form is used, J cannot
distinguish between m} and u} and assumes the m} form,
producing an index error. To me, if I am correct, J should
default to the u} form for gerunds.
13 : ' x #&, i.$ y '
[ #&, [: i. [: $ ]
loc =: [ #&, [: i. [: $ ]
b(('#'"_)`(loc"_)`])}a
|index error
| b (('#'"_)`(loc"_)`])}a
b(('#'"_)`loc`])}a
|index error
| b (('#'"_)`loc`])}a
(B=)
On Fri, 21 Jul 2006, Andrew Nikitin wrote:
+ > ] a =: 5 9 $ '-'
+ > ] b =: ? ($a) $ 2
+
+ In this specific case is no need for special 'indexes' verb; i. will do just
+ fine (with some magic):
+
+ '#' ( b #&, i.$ a )"_ } a
+ ----##--#
+ #-##-##--
+ ###--####
+ #--#-#-#-
+ -####---#
+
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm