When I first saw the question 'How would you make this tacit' my reaction was 'Why would you ever want to, since the explicit version is so easy to understand?'

For practice, maybe.  That's a good reason.  But if you are trying to tune up your tacit forms, you really have to get over any aversion to @ .  The equivalent to

u@v

is

([: u v)"v

Not only is this butt-ugly, it is not recognized by the interpreter, so you miss out on all the fast code for things like <@v ;@:(<@v) etc.

Henry Rich

On 9/11/2018 5:15 AM, 'Mike Day' via Programming wrote:
NB. I've purged most of the earlier posts (below)

Martin Kreuzer's original question was how to handle intermediate results!

Anyway, staying off topic for now,  Ric's tongue-in-cheek proposal is "explicit",
but perhaps you wanted something more so, Linda.

He's got a point, though - would you like it reexpressed in COBOL?

Meanwhile, this _might_ be along the lines you're thinking of:

NB. Ric's tacit verb
pmt=: {: * 1&{ (([: (% <:) (^~ >:)) * ]) 1200 %~ {.

NB. attempt to render it explicit... (explicate it?)
pmte =: 3 : 0
'r t b'   =. y % 1200 1 1
NB. OR: b =. {:y [ t =. 1{y [ r =: 1200%~ {:y  NB.!!!
NB. (^~ >:)                   ===>
incrtot   =. t^~1 + r
NB. OR:   =. (1 + r)^t
NB. ([: (% <:) (^~ >:))       ===>  incrtot % incrtot - 1
NB. (([: (% <:) (^~ >:)) * ]) ===> (incrtot % incrtot - 1) * r
NB. whole thing ===>
b * (incrtot % incrtot - 1) * r
)

BTW, the fragment, incrtot % incrtot - 1, suggests a further refinement -
or is it? - dealing with an intermediate result,  anyway!
incrtot % incrtot - 1
1 % 1 - 1 % incrtot
% 1 - % incrtot
-.&.% incrtot     NB. too tacit?

NB. Also, my antiallergenic tacit version avoiding @ and @:
pmtmd =: [: (*`(] * [: (% <:) (^~ >:))/) 1 1 1200 %~ |.

   'r t b'=. 5.75 240 12500
   (pmt, pmte, pmtmd) r,t,b
87.7604 87.7604 87.7604

FWIW!

Mike


On 11/09/2018 07:58, Ric Sherlock wrote:
Linda,
You may want to define exactly what you mean by "explicitly" and what
you're trying to show/achieve.
Here is a tongue-in-cheek potential solution to your request:

pmt=: 13 : '({: * 1&{ (([: (% <:) (^~ >:)) * ]) 1200 %~ {.) y'

On Tue, Sep 11, 2018 at 2:21 PM Linda Alvord <lindaalvor...@outlook.com>
wrote:

Now can someone, not Ric, write his version explicitly.

PMT=:  13  :
Linda

Sent from my Verizon, Samsung Galaxy smartphone


-------- Original message --------
From: Ric Sherlock <tikk...@gmail.com>
Date: 9/10/18 7:04 PM (GMT-05:00)
To: Programming JForum <programm...@jsoftware.com>
Subject: Re: [Jprogramming] Tacit form: How to handle intermediate

Without @, but IMO this is a case where @ definitely improves readability!

pmt=: {: * 1&{ (([: (% <:) (^~ >:)) * ]) 1200 %~ {.


On Tue, Sep 11, 2018 at 7:06 AM Linda Alvord <lindaalvor...@outlook.com>
wrote:

What if I'm allergic to @ ?

Linda




[snipped the rest - Mike]

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm


---
This email has been checked for viruses by AVG.
https://www.avg.com

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to