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

Reply via email to