Raul,
Ok, I'll go along with your attempt to show programs in the program forum.
I'm intrigued with your updated conjunction plural
plural=: {{ (":m),' ',n,'s'#~1~:m }}
which seems to replace the earlier definition at
https://rosettacode.org/wiki/Bulls_and_cows#J .
I have convinced myself with the following experiment that plural could
have been the VERB pluralv
and "worked" too. But I did not realize that plural executes inside a
script without an x and y.
That's very cool.
plural=: conjunction define
(":m),' ',n,'s'#~1~:m
)
2 plural 'cow'
2 cows
pluralv=: dyad define
(":x),' ',y,'s'#~1~:x
)
2 pluralv 'cow'
2 cows
Initially when I was looking at the bottom of the main verb, bullcow,
I was surprised that plural was not a verb.
I see that one nice thing about it being a conjunction is that you
can enforce its m and n to be numbers, which would be more
difficult with a verb.
Were there other advantages to the conjunction over the verb?
--
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm