you might like

ts2=: +/@(="0 1)


'abc' ts2 'abcbdefbbcbaa'
3 5 2




________________________________
From: Skip Cave <s...@caveconsulting.com>
To: programm...@jsoftware.com 
Sent: Tuesday, September 13, 2016 7:48 PM
Subject: Re: [Jprogramming] Counting characters


Bob,

Drat! I was hoping I could just take the expression:
+/"1'abc'=/'abcbdefbbcbaa'
Which works fine, and just turn it into a tacit verb definition without
fiddling with it:
ts1 =. +/"1'abc'=/]
Or better yet:
ts1 =. +/"1'abc'=/
Apparently, when I removed the noun argument, the phrase turned into a
'hook'.

I have no idea why this happened. Seems like you should be able to get a
verb phrase working with an argument, and then remove the noun and add an
assignment to make a tacit verb. Apparently it doesn't work that way though.

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