I'll likely get smacked for wandering off-topic, but consider a Lisp-like
language where you have a dyadic verb called SUB that subtracts its first
argument from its second: e.g. SUB 10 100.
Now (SUB Penalty1 (SUB Penalty2 Score) ) sort of makes sense. But what if
you strip out the parentheses and evaluate from right to left? You get:
SUB Penalty1 SUB Penalty2 Score
or (laying things out a bit more prettily):
SUB Penalty1
SUB Penalty2 Score
The problem is not so much "reading things left to right" as infix
notation. Well, that's the way I see it.
My 2c, Jo.
On 13 May 2016 at 16:24, Joey K Tuttle <[email protected]> wrote:
> As a long time APL/J user - to answe your original question (in the
> context of Score and Penalties being positive numbers) it seems perfectly
> natural to write -
>
> Total=: Score - Penalty1 + Penalty2
>
> or if there were a vector (or even a table) of penalties -
>
> Score - +/Penalties
>
>
> > On 2016 May 12, at 19:33 , Joe Bogner <[email protected]> wrote:
> >
> > So that's what the problem looks like without the blinders of status
> > quo! Looks good, thanks
> >
> > On Thu, May 12, 2016 at 10:04 PM, Raul Miller <[email protected]>
> wrote:
> >> On Thu, May 12, 2016 at 9:21 PM, Joe Bogner <[email protected]>
> wrote:
> >>> How can this be applied to my subtraction issue? At the risk of
> >>> sounding silly, is there any reasonable way to change the equation to
> >>> read from right to left without parentheses?
> >>
> >> Score=: 100
> >> Penalty1=: _10
> >> Penalty2=: _20
> >> [ Total=: Score + Penalty1 + Penalty2
> >>
> >> --
> >> 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