This is also true:

   count=: 0
   3 :'count=:count+1'^:2 3
3 : 'count=:count+1'^:2 3
   count
0

I suppose the question is: did he mean to include a noun argument, or not?

-- 
Raul

On Mon, Jul 11, 2011 at 12:56 PM, Don Guinn <[email protected]> wrote:
> Actually it would be invoked no times as the expression results in a verb
> waiting for a noun argument.
>
> On Mon, Jul 11, 2011 at 10:44 AM, mijj <[email protected]> wrote:
>
>> how many times would the verb [v] be invoked in the following:
>>
>> v^:(1 2)
>>
>> would it be:
>>    once for the [1], and then twice for the [2].
>>    = 3 in total
>> or:
>>    the interpreter checks the numbers for [^:] and works to
>>    minimise number of invocations, so makes use of previous results.
>>    so its once for the [1] and an additional one for the [2]
>>    = 2 in total.
>>    (if that's the case, then would it still be so if the expression
>>    was [v^:(2 1)] ?)
>> ?
>>
>> i feel it's probably the first, but hope it's the second.
>>
>> ----------------------------------------------------------------------
>> 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