g=: 1 :(':';'x u /y')

Without the ':' the verb %g is a monad.

Thanks,

-- 
Raul

On Tue, Dec 3, 2013 at 10:20 PM, Linda Alvord <[email protected]> wrote:
> Raul,  We've been moving for the last several weeks and I haven't studied 
> this yet.
>
> It seems odd that f is so simple and g is impossible.
>
>    f=: 1 :'y u / y'
>    a=:%
>    a f i.4
> 0 0   0        0
> _ 1 0.5 0.333333
> _ 2   1 0.666667
> _ 3 1.5        1
>
>    (i.3)%/i:3
>         0    0  0 0 0   0        0
> _0.333333 _0.5 _1 _ 1 0.5 0.333333
> _0.666667   _1 _2 _ 2   1 0.666667
>
>    g=: 1 :'x u /y'
>    (i.3) a g i:3
> |domain error: scriptd
> |   (i.3)    a g i:3
> |[-17] c:\users\owner\j801-user\temp\113.ijs
>
> Is there an easy way to write  g ?
>
> Linda
>
>
> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Raul Miller
> Sent: Friday, November 15, 2013 7:32 AM
> To: Programming forum
> Subject: Re: [Jprogramming] Times Table Therapy
>
> & is compose here
> http://www.jsoftware.com/help/dictionary/d630v.htm
>
> `:6 is evoke gerund as a train
> http://www.jsoftware.com/help/dictionary/d612.htm
>
> the following / is outer product (or "table") 
> http://www.jsoftware.com/help/dictionary/d420.htm
>
> I imagine you are already familiar with that one?
>
> Here's my session from when I wrote that, along with some notes on my 
> thinking. I am including my mistaken experiments. I think this took me 
> between fifteen minutes and half an hour, but I did not time it so I do not 
> know for sure.
>
> First, I wanted to make sure that the thing worked, so I did a literal copy 
> and paste of your definition of T and then I pasted in the values to try to 
> make it work.
>
>   T=: 1 
> :'(,.(<":u),<":,.>{.y),.(<{.":A),:<}.[A=:(>}.y),".(":,>{.y),(u,,''/''),":,>}.y'
>    '%' 1 
> :'(,.(<":u),<":,.>{.y),.(<{.":A),:<}.[A=:(>}.y),".(":,>{.y),(u,,''/''),":,>}.y'
> (i.3);i:3
> ┌─┬──────────────────────────────────┐
> │%│       _3   _2 _1 0 1   2        3│
> ├─┼──────────────────────────────────┤
> │0│        0    0  0 0 0   0        0│
> │1│_0.333333 _0.5 _1 _ 1 0.5 0.333333│
> │2│_0.666667   _1 _2 _ 2   1 0.666667│
> └─┴──────────────────────────────────┘
>
> Next, I started introducing small changes. I wanted to make sure that I 
> understood what you wrote and sometimes the easiest way of doing that is 
> finding equivalent expressions. And the easiest way there sometimes is to 
> make small changes that seem equivalent. I also wanted a shorter expression 
> so that I did not have so much code to think about. (I prefer to think in 
> transformations of data, and a lot of steps might be easy to write but 
> reading?)
>
> The first thing I did was change ,>}.y on the right to >{:y. Using }.
> on the pair leaves an extra leading dimension (1) which you eliminate through 
> , so why not just use {: and avoid it?
>
>    '%' 1 
> :'(,.(<":u),<":,.>{.y),.(<{.":A),:<}.[A=:(>}.y),".(":,>{.y),(u,,''/''),":>{:y'
> (i.3);i:3
> ┌─┬──────────────────────────────────┐
> │%│       _3   _2 _1 0 1   2        3│
> ├─┼──────────────────────────────────┤
> │0│        0    0  0 0 0   0        0│
> │1│_0.333333 _0.5 _1 _ 1 0.5 0.333333│
> │2│_0.666667   _1 _2 _ 2   1 0.666667│
> └─┴──────────────────────────────────┘
>
> The next thing I did was remove the ravel of the rightmost '/' - it is 
> getting appended to '%' and '%/' is already rank 1.
>
>    '%' 1 
> :'(,.(<":u),<":,.>{.y),.(<{.":A),:<}.[A=:(>}.y),".(":,>{.y),(u,''/''),":>{:y'
> (i.3);i:3
> ┌─┬──────────────────────────────────┐
> │%│       _3   _2 _1 0 1   2        3│
> ├─┼──────────────────────────────────┤
> │0│        0    0  0 0 0   0        0│
> │1│_0.333333 _0.5 _1 _ 1 0.5 0.333333│
> │2│_0.666667   _1 _2 _ 2   1 0.666667│
> └─┴──────────────────────────────────┘
>
> Next I changed u to m. u can be a verb and this code assumes you are using a 
> noun.
>
>    '%' 1 
> :'(,.(<":m),<":,.>{.y),.(<{.":A),:<}.[A=:(>}.y),".(":,>{.y),(m,''/''),":>{:y'
> (i.3);i:3
> ┌─┬──────────────────────────────────┐
> │%│       _3   _2 _1 0 1   2        3│
> ├─┼──────────────────────────────────┤
> │0│        0    0  0 0 0   0        0│
> │1│_0.333333 _0.5 _1 _ 1 0.5 0.333333│
> │2│_0.666667   _1 _2 _ 2   1 0.666667│
> └─┴──────────────────────────────────┘
>
> Next, I wanted to evoke the verb named in m. There's a 128!: foreign which I 
> probably should have used, but I was not sure if ~ could be used on a 
> primitive like this.
>
>    '%' 1 :'(,.(<":m),<":,.>{.y),.(<{.":A),:<}.[A=:(>}.y),".(>{.y)(m~/)>{:y'
> (i.3);i:3
> |ill-formed name
> |   (,.(<":m),<":,.>{.y),.(<{.":A),:<}.[A=:(>}.y),".(>{.y)(    m~/)>{:y
>
> No. So, ok, let's box it and use evoke gerund:
>
>    '%' 1 
> :'(,.(<":m),<":,.>{.y),.(<{.":A),:<}.[A=:(>}.y),".(>{.y)((<m)`:6/)>{:y'
> (i.3);i:3
> |domain error
> |   (,.(<":m),<":,.>{.y),.(<{.":A),:<}.[A=:(>}.y),    ".(>{.y)((<m)`:6/)>{:y
>
> Oops, I am computing a numeric result, so the ". has to go.
>
>    '%' 1 :'(,.(<":m),<":,.>{.y),.(<{.":A),:<}.[A=:(>}.y),(>{.y)((<m)`:6/)>{:y'
> (i.3);i:3
> ┌─┬──────────────────────────────────┐
> │%│       _3   _2 _1 0 1   2        3│
> ├─┼──────────────────────────────────┤
> │0│        0    0  0 0 0   0        0│
> │1│_0.333333 _0.5 _1 _ 1 0.5 0.333333│
> │2│_0.666667   _1 _2 _ 2   1 0.666667│
> └─┴──────────────────────────────────┘
>
> Now let's try cleaning it up, using an outer product instead of taking apart 
> boxes individually.
>
>    '%' 1 :'(,.(<":m),<":,.>{.y),.(<{.":A),:<}.[A=:(>}.y),((<m)`:6/)&>/>y'
> (i.3);i:3
> ┌─┬──────────────────┐
> │%│_3   _2 _1 0 1 2 3│
> ├─┼──────────────────┤
> │0│0 _0.5 _2 0 0 0 0 │
> │1│                  │
> │2│                  │
> └─┴──────────────────┘
>
> Oops, I need to compose unbox with the outer product, so that leads us to the 
> /&> part you were asking about.
>
>    '%' 1 :'(,.(<":m),<":,.>{.y),.(<{.":A),:<}.[A=:(>}.y),((<m)`:6/)&>/y'
> (i.3);i:3
> ┌─┬──────────────────────────────────┐
> │%│       _3   _2 _1 0 1   2        3│
> ├─┼──────────────────────────────────┤
> │0│        0    0  0 0 0   0        0│
> │1│_0.333333 _0.5 _1 _ 1 0.5 0.333333│
> │2│_0.666667   _1 _2 _ 2   1 0.666667│
> └─┴──────────────────────────────────┘
>
> Now I can also get rid of the (>}.y), by putting a [, inside my outer product 
> verb. (This is wrong, by the way - can you see my mistake?)
>
>    '%' 1 :'(,.(<":m),<":,.>{.y),.(<{.":A),:<}.[A=:([,(<m)`:6/)&>/y' (i.3);i:3 
> ┌─┬──────────────────────────────────┐
> │%│        0    1  2 0 0   0        0│
> ├─┼──────────────────────────────────┤
> │0│        0    0  0 0 0   0        0│
> │1│_0.333333 _0.5 _1 _ 1 0.5 0.333333│
> │2│_0.666667   _1 _2 _ 2   1 0.666667│
> └─┴──────────────────────────────────┘
>
> Now let's get rid of the [ to the left of A=: since it is doing nothing 
> useful for us.
>
>    '%' 1 :'(,.(<":m),<":,.>{.y),.(<{.":A),:<}.A=:([,(<m)`:6/)&>/y' (i.3);i:3 
> ┌─┬──────────────────────────────────┐
> │%│        0    1  2 0 0   0        0│
> ├─┼──────────────────────────────────┤
> │0│        0    0  0 0 0   0        0│
> │1│_0.333333 _0.5 _1 _ 1 0.5 0.333333│
> │2│_0.666667   _1 _2 _ 2   1 0.666667│
> └─┴──────────────────────────────────┘
>
> Now let's clean up the manipulations on the left side of A which build those 
> labels. I basically want the first row of A in a separate box from the rest 
> of A, right?
>
>    '%' 1 :'(,.(<":m),<":,.>{.y),.({.,:&<}.)A=:([,(<m)`:6/)&>/y' (i.3);i:3 
> ┌─┬──────────────────────────────────┐
> │%│0 1 2 0 0 0 0                     │
> ├─┼──────────────────────────────────┤
> │0│        0    0  0 0 0   0        0│
> │1│_0.333333 _0.5 _1 _ 1 0.5 0.333333│
> │2│_0.666667   _1 _2 _ 2   1 0.666667│
> └─┴──────────────────────────────────┘
>
> Uh... right about here, I notice that I've messed things up. My top row is 
> just wrong. So let's abandon the above line of thought and just try making a 
> table that contains the top row and left column. I can't use '%' here but I 
> am just trying to untangle my thoughts, so I'll use a 0 for now until I have 
> figured out how to manipulate the rest of the data.
>
>    '%' 1 :'(0,>{:y),([,(<m)`:6/)&>/y' (i.3);i:3
>         0   _3 _2 _1 0   1        2 3
>         0    1  2  0 0   0        0 0
>         0    0  0  0 0   0        0 0
> _0.333333 _0.5 _1  _ 1 0.5 0.333333 0
> _0.666667   _1 _2  _ 2   1 0.666667 0
>
> Ok, that is wrong because I have no leftmost column and I have two label rows 
> on top. Right about here, I noticed that I should have been using ], inside 
> my outer product, instead of [, (I want the contents of the righthand box not 
> the lefthand box).
>
>    '%' 1 :'(0,>{.y),(],(<m)`:6/)&>/y' (i.3);i:3
>         0    0  1 2 0   0        0
>        _3   _2 _1 0 1   2        3
>         0    0  0 0 0   0        0
> _0.333333 _0.5 _1 _ 1 0.5 0.333333
> _0.666667   _1 _2 _ 2   1 0.666667
>
> Here, I have reversed my two label columns. I think here I noticed that my 
> left column is going on top instead of on the left. Rather than reason about 
> that, I simplify my expression further and ignore the leftmost column for a 
> moment. (It's easier to just perform experiments and glance at them than it 
> is to think things through.
> Probably not the smartest technique, but do not accuse me of being smart and 
> we will be ok.)
>
>    '%' 1 :'(],(<m)`:6/)&>/y' (i.3);i:3
>        _3   _2 _1 0 1   2        3
>         0    0  0 0 0   0        0
> _0.333333 _0.5 _1 _ 1 0.5 0.333333
> _0.666667   _1 _2 _ 2   1 0.666667
>
> Good. Here I have the table I want (without the boxes and without the left 
> column). So let's grab out the boxes:
>
>    '%' 1 :'({.;}.)(],(<m)`:6/)&>/y' (i.3);i:3 
> ┌────────────────┬──────────────────────────────────┐
> │_3 _2 _1 0 1 2 3│        0    0  0 0 0   0        0│
> │                │_0.333333 _0.5 _1 _ 1 0.5 0.333333│
> │                │_0.666667   _1 _2 _ 2   1 0.666667│
> └────────────────┴──────────────────────────────────┘
>
> Good enough? Not quite but I have not noticed that yet, so let's add the left 
> column.
>
>    '%' 1 :'(m;,.>{.y),.({.;}.)(],(<m)`:6/)&>/y' (i.3);i:3 
> ┌─┬──────────────────────────────────┐
> │%│_3 _2 _1 0 1 2 3                  │
> ├─┼──────────────────────────────────┤
> │0│        0    0  0 0 0   0        0│
> │1│_0.333333 _0.5 _1 _ 1 0.5 0.333333│
> │2│_0.666667   _1 _2 _ 2   1 0.666667│
> └─┴──────────────────────────────────┘
>
> Oh, right, I need to format the top row or it will not retain spacing when 
> separated from the bottom row
>
>    '%' 1 :'(m;,.>{.y),.({.;}.)":(],(<m)`:6/)&>/y' (i.3);i:3 
> ┌─┬──────────────────────────────────┐
> │%│       _3   _2 _1 0 1   2        3│
> ├─┼──────────────────────────────────┤
> │0│        0    0  0 0 0   0        0│
> │1│_0.333333 _0.5 _1 _ 1 0.5 0.333333│
> │2│_0.666667   _1 _2 _ 2   1 0.666667│
> └─┴──────────────────────────────────┘
>
> Done.
>
> For this case I did not need to format the bottom right box, but in obscure 
> irrelevant cases that might be a good idea (like imagine the top row was 0 
> 0.5 1 1.5 2 and the left column was 0 2 4 and the value for m was '*').
>
> That said, I should probably have instead used
>    '%' 1 :'(m;,.>{.y),.({.;}.)":(''(],('',m,'')/)&>/'')128!:2 y' (i.3);i:3
>
> Because it makes more sense to think of m as a string representing a verb 
> than it does to think of m as representing an unboxed gerund.
>
> Thanks,
>
> --
> Raul
>
> On Fri, Nov 15, 2013 at 2:28 AM, Linda Alvord <[email protected]> wrote:
>>  What definition of  &  is applied here?
>>
>>    s=: 4 :'(],(<x)`:6/)&>/y'
>>    '%' s (i.3);i:3
>>        _3   _2 _1 0 1   2        3
>>         0    0  0 0 0   0        0
>> _0.333333 _0.5 _1 _ 1 0.5 0.333333
>> _0.666667   _1 _2 _ 2   1 0.666667
>>
>> How does it work?  I did find an explanation for  `6/ but I can't find it 
>> again.
>>
>> Linda
>>
>>
>>
>> -----Original Message-----
>> From: [email protected]
>> [mailto:[email protected]] On Behalf Of Raul
>> Miller
>> Sent: Wednesday, November 13, 2013 7:38 AM
>> To: Programming forum
>> Subject: Re: [Jprogramming] Times Table Therapy
>>
>> Would
>>    '%' 1 :'(m;,.>{.y),.({.;}.)":(],(<m)`:6/)&>/y' (i.3);i:3 or
>>
>>    '%' 4 :'(x;,.>{.y),.({.;}.)":(],(<x)`:6/)&>/y' (i.3);i:3
>>
>>
>> be acceptable?
>>
>> The part to the right of the ": is essentially the same thing as your A.
>>
>> But note that I prefer to leave both the top and bottom boxes on the right 
>> formatted (where you only left the top box formatted).
>>
>> Thanks,
>>
>> --
>> Raul
>>
>>
>> On Wed, Nov 13, 2013 at 3:27 AM, Linda Alvord <[email protected]>wrote:
>>
>>> Thanks Raul.  Here's the finished function.  I would like not to
>>> include  A .  Any ideas:
>>>
>>>    a=:'%'
>>>    b=:i:3
>>>    c=:i.3
>>>    d=:c;b
>>>
>>>    T=: 1
>>> :'(,.(<":u),<":,.>{.y),.(<{.":A),:<}.[A=:(>}.y),".(":,>{.y),(u,,''/''),":,>}.y'
>>>    a T d
>>> ┌─┬──────────────────────────────────┐
>>> │%│       _3   _2 _1 0 1   2        3│
>>> ├─┼──────────────────────────────────┤
>>> │0│        0    0  0 0 0   0        0│
>>> │1│_0.333333 _0.5 _1 _ 1 0.5 0.333333│
>>> │2│_0.666667   _1 _2 _ 2   1 0.666667│
>>> └─┴──────────────────────────────────┘
>>>
>>>    '>.' T (i:4);i:4
>>> ┌──┬─────────────────────┐
>>> │>.│_4 _3 _2 _1 0 1 2 3 4│
>>> ├──┼─────────────────────┤
>>> │_4│_4 _3 _2 _1 0 1 2 3 4│
>>> │_3│_3 _3 _2 _1 0 1 2 3 4│
>>> │_2│_2 _2 _2 _1 0 1 2 3 4│
>>> │_1│_1 _1 _1 _1 0 1 2 3 4│
>>> │ 0│ 0  0  0  0 0 1 2 3 4│
>>> │ 1│ 1  1  1  1 1 1 2 3 4│
>>> │ 2│ 2  2  2  2 2 2 2 3 4│
>>> │ 3│ 3  3  3  3 3 3 3 3 4│
>>> │ 4│ 4  4  4  4 4 4 4 4 4│
>>> └──┴─────────────────────┘
>>>
>>>
>>> Linda
>>>
>>> -----Original Message-----
>>> From: [email protected] [mailto:pro
>>> [email protected]] On Behalf Of Raul Miller
>>> Sent: Saturday, November 09, 2013 8:45 AM
>>> To: Programming forum
>>> Subject: Re: [Jprogramming] Times Table Therapy
>>>
>>> First, g seemed a bit overly ornate, so I took the liberty of putting
>>> it through a weight loss program:
>>>
>>>    % 1 :'<}.":(>}.y),(>{.y)u/,>}.y' (i.3) ,&< i:3
>>>
>>>    % 1 :'<}.":(>}.y),(>{.y)u/,>{:y' (i.3) ,&< i:3
>>>
>>>    % 1 :'<}.":(>}.y),(>{.y)u/>{:y' (i.3) ,&< i:3
>>>
>>>    % 1 :'<}.":(>}.y),u/&>/y' (i.3) ,&< i:3
>>>
>>>    % 1 :'<}.":(],u/)&>/y' (i.3) ,&< i:3
>>>
>>>
>>> (these all have the same result as a g d)
>>>
>>>
>>> The phrase U&>/Y would apply the verb U between the contents of the
>>> two boxes of Y (if Y is a pair of boxes). And, in this case, U would
>>> be a verb with the result: "contents of the second box and a u table".
>>>
>>>
>>> I am more comfortable with the short form than the long form because
>>> the short form leaves me with extra space on the line so I can
>>> inspect the rest of the sentence.
>>>
>>>
>>> Anyways, note that we can get the top row back by getting rid of the
>>> behead, like this:
>>>
>>>     % 1 :'<":(],u/)&>/y' (i.3) ,&< i:3
>>>
>>> ┌──────────────────────────────────┐
>>>
>>> │       _3   _2 _1 0 1   2        3│
>>>
>>> │        0    0  0 0 0   0        0│
>>>
>>> │_0.333333 _0.5 _1 _ 1 0.5 0.333333│
>>>
>>> │_0.666667   _1 _2 _ 2   1 0.666667│
>>>
>>> └──────────────────────────────────┘
>>>
>>>
>>> If you want the top row in a different box from the rest of the rows,
>>> you can replace that leading < with ,.@({.;}.)
>>>
>>>
>>> Does this help?
>>>
>>>
>>> Thanks,
>>>
>>>
>>> --
>>>
>>> Raul
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Sat, Nov 9, 2013 at 3:15 AM, Linda Alvord <[email protected]
>>> >wrote:
>>>
>>> > Thanks.  I’m starting to understand things better.  Here is my next
>>> > problem.
>>> >
>>> >    a=:%
>>> >    b=:i:3
>>> >    c=:i.3
>>> >    d=:(<c),<b
>>> >
>>> >    ]M=:":(>}.d),(>{.d)a/,>}.d
>>> >        _3   _2 _1 0 1   2        3
>>> >         0    0  0 0 0   0        0
>>> > _0.333333 _0.5 _1 _ 1 0.5 0.333333
>>> > _0.666667   _1 _2 _ 2   1 0.666667
>>> >    (<{.M),:<}.M
>>> > ┌──────────────────────────────────┐
>>> > │       _3   _2 _1 0 1   2        3│
>>> > ├──────────────────────────────────┤
>>> > │        0    0  0 0 0   0        0│
>>> > │_0.333333 _0.5 _1 _ 1 0.5 0.333333│
>>> > │_0.666667   _1 _2 _ 2   1 0.666667│
>>> > └──────────────────────────────────┘
>>> >
>>> >    f=: 1 :'":(>}.y),(>{.y)u/,>}.y'
>>> >    a f d
>>> >        _3   _2 _1 0 1   2        3
>>> >         0    0  0 0 0   0        0
>>> > _0.333333 _0.5 _1 _ 1 0.5 0.333333
>>> > _0.666667   _1 _2 _ 2   1 0.666667
>>> >
>>> >    g=: 1 :'<}.":(>}.y),(>{.y)u/,>}.y'
>>> >    a g d
>>> > ┌──────────────────────────────────┐
>>> > │        0    0  0 0 0   0        0│
>>> > │_0.333333 _0.5 _1 _ 1 0.5 0.333333│
>>> > │_0.666667   _1 _2 _ 2   1 0.666667│
>>> > └──────────────────────────────────┘
>>> >
>>> > I want to modify  g  so that it attaches the top row with correct
>>> > spacing as shown above.
>>> >
>>> > Linda
>>> >
>>> >
>>> > -----Original Message-----
>>> > From: [email protected] [mailto:
>>> > [email protected]] On Behalf Of Raul Miller
>>> > Sent: Friday, November 08, 2013 7:57 AM
>>> > To: hProgramming forum
>>> > Subject: Re: [Jprogramming] Times Table Therapy
>>> >
>>> > http://www.jsoftware.com/help/dictionary/cret.htm explains that return.
>>> > exits an explicit definition.
>>> >
>>> > http://www.jsoftware.com/help/dictionary/d521.htm explains that the
>>> > result of {. is the leading item of an array (which means one
>>> > dimension less than the table).
>>> >
>>> > I'll presume that I do not need to document "behead" but just in
>>> > case some of the younger readers are curious:
>>> > http://www.jsoftware.com/help/dictionary/d531.htm
>>> >
>>> > Thanks,
>>> >
>>> > --
>>> > Raul
>>> >
>>> >
>>> >
>>> > On Fri, Nov 8, 2013 at 3:26 AM, Linda Alvord
>>> > <[email protected]
>>> > >wrote:
>>> >
>>> > > What does  return.  Mean?
>>> > >
>>> > > Also:
>>> > >
>>> > >    a=:*
>>> > >    b=:i:5
>>> > >    c=:i.3
>>> > >    d=:(<c),<b
>>> > >
>>> > >    c */b
>>> > >   0  0  0  0  0 0 0 0 0 0  0
>>> > >  _5 _4 _3 _2 _1 0 1 2 3 4  5
>>> > > _10 _8 _6 _4 _2 0 2 4 6 8 10
>>> > >
>>> > >    (>{.d)
>>> > > 0 1 2
>>> > >    >}.d
>>> > > _5 _4 _3 _2 _1 0 1 2 3 4 5
>>> > >
>>> > >   (>{.d) */ >}.d
>>> > >   0  0  0  0  0 0 0 0 0 0  0
>>> > >
>>> > >  _5 _4 _3 _2 _1 0 1 2 3 4  5
>>> > >
>>> > > _10 _8 _6 _4 _2 0 2 4 6 8 10
>>> > >
>>> > >    $ (>{.d) */ >}.d
>>> > > 3 1 11
>>> > >
>>> > > So:
>>> > >
>>> > >     (>{.d) */, >}.d
>>> > >   0  0  0  0  0 0 0 0 0 0  0
>>> > >  _5 _4 _3 _2 _1 0 1 2 3 4  5
>>> > > _10 _8 _6 _4 _2 0 2 4 6 8 10
>>> > >
>>> > >  Why is  ({.c) a list and  (}.d) a table?
>>> > >
>>> > > Linda
>>> > >
>>> > >
>>> > > -----Original Message---
>>> > > From: [email protected] [mailto:
>>> > > [email protected]] On Behalf Of Raul
>>> > > Miller
>>> > > Sent: Thursday, November 07, 2013 10:07 AM
>>> > > To: Programming forum
>>> > > Subje.ct: Re: [Jprogramming] Times Table Therapy
>>> > >
>>> > > We can replace
>>> > >     g=: 1 :',.(":u),":,.>{.y'
>>> > > with
>>> > >    g=: 1 :',.(":5!:5<''u''),":,.>{.y'
>>> > >
>>> > > A problem is that u is a verb in your example, and you want a
>>> > > noun representation of it.
>>> > >
>>> > > But this runs into a problem:
>>> > >
>>> > >    g=: 1 :',.(":5!:5<''u''),":,.>{.y'
>>> > >    * g (<i.3),<i.5
>>> > > |value error: y
>>> > > |   ,.(":5!:5<'u'),":,.>{.    y
>>> > >
>>> > > We need an unquoted reference to u (or one of the other such
>>> > > names), or x and y are interpreted to mean u and v.
>>> > >
>>> > > So:
>>> > >
>>> > >    g=: 1 :',.(":5!:5<''u''),":,.>{.y return. u'
>>> > >    * g (<i.3),<i.5
>>> > > *
>>> > > 0
>>> > > 1
>>> > > 2
>>> > >
>>> > > Does this make sense?
>>> > >
>>> > > --
>>> > > Raul
>>> > >
>>> > >
>>> > >
>>> > > On Wed, Nov 6, 2013 at 11:07 PM, Linda Alvord
>>> > > <[email protected]
>>> > > >wrote:
>>> > >
>>> > > >  This the data I want to use:
>>> > > >
>>> > > >   a=:*
>>> > > >    b=:i:5
>>> > > >    c=:i.3
>>> > > >    ]d=:(<c),<b
>>> > > > ┌─────┬──────────────────────────┐
>>> > > > │0 1 2│_5 _4 _3 _2 _1 0 1 2 3 4 5│
>>> > > > └─────┴──────────────────────────┘
>>> > > >
>>> > > > This this is the correct result with the wrong data:
>>> > > >
>>> > > >    a=:'*'
>>> > > >    f=: 1 :',.(":u),":,.>{.y'
>>> > > >    a f d
>>> > > > *
>>> > > > 0
>>> > > > 1
>>> > > > 2
>>> > > >
>>> > > > Here is the error I can’t fix:
>>> > > >    a=:*
>>> > > >    g=: 1 :',.(":u),":,.>{.y'
>>> > > >    a g d
>>> > > > |domain error: a
>>> > > > |   ,.    (":u),":,.>{.y
>>> > > >
>>> > > >
>>> > > > Is there a way to make  g  work correctly?
>>> > > >
>>> > > > Linda
>>> > > >
>>> > > >
>>> > > > -----Original Message-----
>>> > > > From: [email protected] [mailto:
>>> > > > [email protected]] On Behalf Of Roger
>>> > > > Hui
>>> > > > Sent: Sunday, November 03, 2013 7:02 PM
>>> > > > To: Programming forum
>>> > > > Subject: Re: [Jprogramming] Times Table Therapy
>>> > > >
>>> > > > > My first adverb!  Linda
>>> > > >
>>> > > > Given the topic and the person, it seems appropriate to point
>>> > > > out that
>>> > > Ken
>>> > > > Iverson credited Linda Alvord for getting over a pedagogic hurdle.
>>> > > > From *Kenneth
>>> > > > E. Iverson <http://www.jsoftware.com/papers/autobio.htm>*,
>>> > > > 2008,
>>> > section
>>> > > > 5:
>>> > > >
>>> > > > There were also surprises in the writing.  Although the great
>>> > > > utility
>>> > of
>>> > > > matrices was recognized (as in a 3-by-2 to represent a
>>> > > > triangle), there
>>> > > was
>>> > > > a great reluctance to use them because the concept was
>>> > > > considered to be
>>> > > too
>>> > > > difficult.
>>> > > >
>>> > > > Linda Alvord said to introduce the matrix as an outer product —
>>> > > > an idea that the rest of us thought outrageous, until Linda
>>> > > > pointed out that
>>> > the
>>> > > > kids already knew the idea from familiar addition and
>>> > > > multiplication
>>> > > tables.
>>> > > >
>>> > > >
>>> > > >
>>> > > >
>>> > > > On Sun, Nov 3, 2013 at 7:04 AM, Linda Alvord
>>> > > > <[email protected]
>>> > > > >wrote:
>>> > > >
>>> > > > >
>>> > > > > My first adverb!  Linda
>>> > > > >
>>> > > > ---------------------------------------------------------------
>>> > > > ---
>>> > > > ---- 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
>>> > >
>>> > -------------------------------------------------------------------
>>> > --- 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
>>>
>> ----------------------------------------------------------------------
>> 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
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to