Suppose:   ff=: 13 :'>:i.y'
   ff
>:@i.
Then:   
  >:@i.4
1 2 3 4
Which is what you want, more than a domain error.

Linda

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Kip Murray
Sent: Monday, February 9, 2015 8:08 AM
To: [email protected]
Subject: Re: [Jprogramming] Source of frustration

>From E. Parsing and Execution in the Dictionary:

One important consequence of these rules is that in an unparenthesized
expression the right argument of any verb is the result of the entire phrase
to its right. The sentence 3*p%q^|r-5 can therefore be *read* from left to
right: the overall result is 3 times the result of the remaining phrase,
which is the quotient of p and the part following the % , and so on.


In your sentence [: >: i. 4

the verb Cap [: is applied to the result of >: i. 4 -- so you get a domain
error.

I suppose Cap [: is your source of frustration!

--Kip

On Monday, February 9, 2015, Linda Alvord <[email protected]> wrote:

> Using J as a calculator, the first option is most appropriate.
>
>
>
>   >: i.4
>
> 1 2 3 4
>
>
>
>    >:@i.4
>
> 1 2 3 4
>
>
>
>   :>:i.4
>
> |domain error
>
> | | [:>:i.4
>
>
>
> However, f displays to one style that has a domain error.  What if f 
> displayed the same result as g ?
>
>
>
>    f=: 13 :'>:i.y'
>
>    f 4
>
> 1 2 3 4
>
>    f
>
> [: >: i.
>
>
>
>    g=: 13 :'>:@i.y'
>
>    g 4
>
> 1 2 3 4
>
> g
>
> >:@i.
>
>
>
> Linda
>
>
>
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>


--
Sent from Gmail Mobile
----------------------------------------------------------------------
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