On second thought, you could make a parser that applies the function to formal parameters x and y, and checks whether the results are the same, which should work for functions as simple as yours. Stay tuned--I might actually write this.
Marshall 2011/11/10 Marshall Lochbaum <[email protected]> > Look at the code and scratch your head. J doesn't have that kind of power. > > Marshall > > 2011/11/10 Linda Alvord <[email protected]> > >> š a=: 0 : 0 >> >> a is a >> b is not a >> c is a or not a >> ) >> š a >> >> a is a >> b is not a >> c is a or not a >> >> š b=: <;._2 a >> š b >> -------T----------T---------------ƒ >> >> a is a b is not a c is a or not a >> L------+----------+---------------- >> >> šf=: 13 :'x&(+./@E.)&>y' >> šf >> 4 : 'x&(+./@E.)&>y' >> >> š'is a' f b >> 1 0 1 >> >> š'not a' f b >> 0 1 1 >> >> Also: >> >> šg=: 13 :'+/"1 x E."1 > y' >> šg >> [: +/"1 [ E."1 [: > ] >> >> š'is a' g b >> 1 0 1 >> >> š'not a' g b >> >> 0 1 1 >> >> Is there a way to determine if f and g are the same if they are used >> dyadically? >> >> >> -----Original Message----- >> From: [email protected] >> [mailto:[email protected]] On Behalf Of Roger Hui >> Sent: Thursday, November 10, 2011 12:45 PM >> To: Programming forum >> Subject: Re: [Jprogramming] Boxing and Finding >> >> 1. t=: <;._2 s >> 2. 'sub'&(+./@E.)&> t >> >> >> >> On Thu, Nov 10, 2011 at 9:36 AM, Skip Cave <[email protected]> >> wrote: >> > Two questions, >> > >> > 1. I have a text array where each line is terminated with a line feed. >> How >> > do you box each line of that text array to create an array of boxed text >> > strings? >> > >> > 2. When you have an array of boxed text strings, how do you create a >> > boolean array that indicates which boxes contain a particular text >> string? >> > >> > 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 >> >> ---------------------------------------------------------------------- >> For information about J forums see http://www.jsoftware.com/forums.htm >> > > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
