The only reason I made 'plural' be a conjunction rather than a verb was to eliminate the need for parenthesis when using it.
Generally speaking when we generate text in J, we have a tendency to be overly cluttered in our code. This was a small and easy decision to combat that issue. Thanks, -- Raul On Sat, Feb 27, 2021 at 4:38 PM Brian Schott <[email protected]> wrote: > > 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 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
