[Jprogramming] Counting characters
'Pascal Jasmin' via Programming
programming at jsoftware.com
Wed Sep 14 03:13:05 UTC 2016
you might like
ts2=: +/@(="0 1)
'abc' ts2 'abcbdefbbcbaa'
3 5 2
________________________________
From: Skip Cave <skip at caveconsulting.com>
To: programming at 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
More information about the Programming
mailing list