[Jprogramming] explicit definition of power series

Lippu Esa Esa.Lippu at varma.fi
Fri Jan 3 06:51:18 UTC 2014


Hi Daniel!

The book uses the old J syntax. Drop the dots from u., x. and y. and it works.

Welcome to the community!

Esa

-----Original Message-----
From: programming-bounces at forums.jsoftware.com [mailto:programming-bounces at forums.jsoftware.com] On Behalf Of Daniel Valentino
Sent: 3. tammikuuta 2014 8:34
To: programming at jsoftware.com
Subject: [Jprogramming] explicit definition of power series

Hi:

I am very new to J, and not very experienced with functional programming,
but I am trying to use J for a data analytics project that involves a lot
of statistical analysis.  In learning to program in J, I started to run
some of the examples from Ken Iverson's Calculus book, and I'm having
trouble with the following:
PS =: 1 : (':'; '(u. x.) p. y.')   NB. explicit definition of power series

On my system, it reports an error: "spelling error" with the caret under
the u.  I found the u. operator in the dictionary, and it appears to be a
unicode operator, but it doesn't appear to be defined in my J interpreter.

I tried the following:
s1 =: $&(0 1)
x =: (i.6)%2

5 s1 PS x

x1 and x appear to be defined correctly, but I get the "spelling error"
message when I use the PS operator:

spelling error
|   (u. x.) p. y.
|    ^
|   PS=:    1 :(':';'(u. x.) p. y.')

I am using J version j64-701gtk on Windows 7, SP1, 64 bit (intel i7).

Is this an appropriate question for this forum, or should I post this
message elsewhere?  If it is appropriate, can someone help me to understand
the definition of the PS operator, and does anyone recognize why I'm
getting the reported error?

Thanks in advance for any help!

Sincerely,
Daniel
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm


More information about the Programming mailing list