Thank you for your insightful response.
There are two aspects in my original posting; one is avoiding using
multiple arguments and as a side effect, discovering important
concepts from that, and the other is the possibility of building
English-like expressions in J.
I would put more value in the first aspect. The latter was more of an
experimentation.
If I saw a verb that computes compound-interested value of a principal
for a period as:
compound=: verb define
'principal interest period'=.y
NB. do the calculation with the three arguments
)
and then reaching towards:
compound2=:verb define
'principal interest period paymentcount'=.y
NB. do the calculation with the four arguments
)
I would say they are decomposable into serveral pieces and I think I
showed one possibility.
June
On 4/2/06, Miller, Raul D <[EMAIL PROTECTED]> wrote:
> June Kim wrote:
> > NB. times per year
> > tpy=:conjunction : (':';' (x%u) v (y*u) ')
> > (2000*(1+0.095%3)^3*5)-: 2000 at 9.5 percent 3 tpy compoundfor 5
> years
>
> I don't have anything major to contribute here, but note that
> I prefer to follow the m vs. u argument convention, where I use
> m if I expect the argument to be a noun.
>
> tpy1=:conjunction : (':';' (x%m) v (y*m) ')
>
> But I'd also prefer that tpy produce an intermediate
> result which doesn't literally quote the body of tpy.
>
> tpy2=:conjunction : (':';' ([%m[]) v (]*m[]) ')
>
> Of course, that's a bit verbose. Since the result
> is now a verb distinct from the conjunction we don't
> need ':' any more:
>
> tpy3=:conjunction : ' ([%m[]) v (]*m[]) '
>
> Also, we could make that shorter by commuting the arguments
> and discarding some irrelevant punctuation
>
> tpy4=:conjunction :'(m%~[) v m*]'
>
> Also, I should mention if I felt it was important to have
> 'years' as an identity adverb, I think I'd also want 'annually'
> as an identity adverb.
>
> This would make the above expression even more verbose
> ('percent annually', rather than 'percent') and bury
> the significant operations even deeper, but that might
> not matter, depending on target audiences and intended
> applications.
>
> (Personally, I find the J expressions (such as on the left
> side of -: above) easier to digest than the more verbose
> statements (such as on the right side of -: above).)
>
> Presenting both side by side could be good, depending
> on the audience, but from my point of view both the
> concepts and the results are important, and they work
> together. The results illustrate the concepts and the
> concepts make the results relevant.
>
> Thus,
> (1+0.05%12)^12
> 1.05116
> 5 percent annually 12 timesPerYear compoundFor 1 year
> 1.05116
>
> and
> 12 timesPerYear compoundFor f.
> (12 %~ [) (>:@[ ^ ]) 12 * ]
>
> Note: in principle, J might have rearranged
> that verb so that it displays as >:@(12 %~ [) ^ 12 * ]
>
> But other changes might also be a good idea:
>
> To my way of thinking, 5 percent annual interest compounded
> 12 times per year should correspond to a monthly interest
> of 1.05^%12 -- that it does not says something about
> banking practices, and about the verbal shortcuts that have
> come to be accepted as standard.
>
> I'm not sure how best to express all these concepts in English,
> on an expression-by-expression basis, and usually I don't try.
>
> In other words: while this is probably a worthy subject,
> I think the implicit assumptions are the trickiest aspect
> of the issue.
>
> --
> 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