You probably misspelled SumOfFact in the second call, or SumOfFact 's 
definition is not in the current locale or hasn't been defined/loaded.


----- Original Message -----
From: alessandro codenotti <[email protected]>
To: Real programming posting <[email protected]>
Cc: 
Sent: Thursday, September 4, 2014 2:55:31 PM
Subject: [Jprogramming] repeated applications of a verb

I'm working on PE#74, which asks for the sum of the factorials of the digits in 
a number 
(i.e. if the number is 169 then it asks for 1!+6!+9!).

I wrote this verb that performs the required operation:
SumOfFact=: 3 : 0
     +/!"."0@": y
)
It works perfectly, but now I need to reiterate it to produce a chain like 169 
-> 363601 -> 1454 -> 169,so I tried:
SumOfFact^:3 169

But instead of working as I hoped it simply writes "SumOfFact^:3 169" as output.

What am I doing wrong and how am I supposed to repeatedly apply a verb to an 
argument?
                          
----------------------------------------------------------------------
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