[Jprogramming] total number of invocations of v in v^:(1 2)
Raul Miller
rauldmiller at gmail.com
Tue Jul 12 00:59:52 HKT 2011
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 <donguinn at gmail.com> 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 <mail at mijj.me.uk> 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
>
More information about the Programming
mailing list