Getting all pairs of y and apply a dyadic verb f to them(the order of
the result doesn't matter):

  f=: ,     NB. f is the verb to apply

  ([:; [EMAIL PROTECTED]@$ <@}."0 2 ]) f"0/~ 'abcd'
aa
ab
ac
ad
bb
bc
bd
cc
cd
dd

I used a couple of rank adverbs. However, I don't usually like rank
adverbs; I see them as the last resort.

Different approach, embedded in a user defined adverb:

  ap=: 1 : 0
   ; (<"0 y) u each <\.y
)

  ,"0 ap 'abcd'
aa
ab
ac
ad
bb
bc
bd
cc
cd
dd

I have a feeling that there may be simpler and (hence) more beautiful
approaches in J. Any suggestions?

Thanks in advance.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to