About [
2 [ 3
2
[ 3
3
Thus [ is a verb. In general x [ y is x and [ y is y .
About g
# 1 2
2
1 2 g 3 4 5
0.5
# 3 4 5
3
g 3 4 5
0.333333
About f
0 1 2 # 3 4 5
4 5 5
0 1 2 f 3 4 5
0.25 0.2 0.2
# 3 4 5
3
f 3 4 5
0.333333
Kip
On 2/5/2012 9:32 PM, Linda Alvord wrote:
> Dave Lambert mentioned to me in a post that I had made a typing error typing
> x instead of y :
>
> i=: 13 :'*:@+/x'
> i i.4
> 456976
>
> So, here are two questions:
>
> f=: 13 :'%#y'
> f
> [: % #
> g=: 13 :'%#x'
> g
> [: % [: # [
>
> Is g a request for a dyadic function or a monadic one? Since the results
> are different, why does g have the right [: before (to the right of) two
> "verbs" if [ represents a noun ?
>
> I've often seen this before and wondered about it.
>
> Linda
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Don Guinn
> Sent: Sunday, February 05, 2012 8:21 AM
> To: Programming forum
> Subject: Re: [Jprogramming] Another early morning exercise
>
> Don't you need to change the x to y?
>
> i=: 13 :'*:@+/y'
> i i.4
> 456976
> i=: 3 :'*:@+/y'
> i i.4
> 456976
> i=: 3 :'*:@+/x'
> i i.4
> 676
>
> On Sun, Feb 5, 2012 at 5:11 AM, Linda Alvord<[email protected]>wrote:
>
>> My goal has been to translate from expressions with @ to ones without
> it.
>>
>>
>>
>> f=: 13 :'x?@$y'
>>
>> 2 3 f 6
>>
>> 2 4 2
>> 3 2 5
>>
>>
>>
>> g=: 13 :'x?$y'
>>
>> 2 3 g 6
>>
>> |length error: g
>> | 2 3 g 6
>>
>>
>>
>> h=: 13 :'?x$y'
>>
>> 2 3 h 6
>>
>> 4 3 1
>> 5 0 1
>>
>>
>>
>> f
>>
>> ?@$
>>
>> h
>>
>> [: ? $
>>
>>
>>
>> Can you rewrite this without @ ?
>>
>>
>>
>> i=: 13 :'*:@+/x'
>>
>> i i.4
>>
>> 456976
>>
>>
>>
>>
>>
>> Linda
>>
>> ----------------------------------------------------------------------
>> 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
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm