I'm not sure I understand the concept of dynamic execution, but I found a
tacit expression which helped me understand the result.

   g=: 13 :'((+/ .* 1&|.)% */)y'
   g 2 3 5
1.03333
   
   h=: 13 :'(y+/ .* 1|.y)% */y'
   h 2 3 5
1.03333
   
   g
(+/ .* 1&|.) % */
   h
(] +/ .* 1 |. ]) % */
   

h in not quite as nice as g, but I found it helpful.

Linda   

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Dan Bronb
Sent: Friday, November 01, 2013 8:15 AM
To: [email protected]
Subject: Re: [Jprogramming] making this tacit

Because with f, you're asking that a NVV train be created dynamically based
on its argument: that is, you're changing syntax during execution.

There is no tacit way to express that -   dynamic execution of code is the
definition of explicit.

-Dan

Please excuse typos; composed on a handheld device.

> On Nov 1, 2013, at 4:30 AM, "Linda Alvord" <[email protected]>
wrote:
> 
> Why isn't f tacit, but g is?
> 
>   f=: 13 :'(+/ .* (1|.y)% */)y'
>   f 2 3 5
> 1.03333
>   f
> 3 : '(+/ .* (1|.y)% */)y'
> 
> 
>   g=: 13 :'((+/ .* 1&|.)% */)y'
>   g 2 3 5
> 1.03333
>   g
> (+/ .* 1&|.) % */
> 
> Linda
> 
> 
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Don 
> Kelly
> Sent: Thursday, October 31, 2013 10:09 PM
> To: [email protected]
> Subject: Re: [Jprogramming] making this tacit
> 
> 
> I made an error (BIG GOOF)and gave a problem other than what I wanted 
> so I sent you and Raul on a wild goose chase.
> Your
> 
> (+/@(*/)@(,: 1&|.) % */) 2 3 5
> 
> and Raul's
>  ((+/ .* 1&|.) % */) 2 3 5
> 
>  Agree and are more material to study, Thanks
> 
> Don
>> On 30/10/2013 5:59 AM, Jan-Pieter Jacobs wrote:
>> I'd write it tacitly like this:
>> 
>>  (+/@(*/)@(,: 1&|.) % */) a b c
>> 
>> This is mainly motivated by the fact that a * b + b* c + c*a  can be 
>> expressed as multiplying with a shifted version, then summing.
>> 
>> Jan-Pieter
>> 
>> 
>> 2013/10/30 Raul Miller <[email protected]>
>> 
>>>> On Wed, Oct 30, 2013 at 2:51 AM, Don Kelly <[email protected]> wrote:
>>>> 
>>>> You are right but it is a bit of serendipity  What I wanted is 
>>>> (a*b+ b*c+c*a ) % c a b .
>>>> it doesn't matter how the pairs are formed in the numerator 
>>>> ac+ba+cb is the same.
>>> Like this?
>>> 
>>>    F=: +/ .* (</~i.3) +/ .* ] % */
>>> 
>>> That's probably awful for speed, but it does express the idea.
>>> 
>>> Thanks,
>>> 
>>> --
>>> Raul
>>> --------------------------------------------------------------------
>>> -
>>> - 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
----------------------------------------------------------------------
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