I struggling to understand divide-reduce.
The plus-reduce and multiply-reduce both seem to combine the running result with the next element, but by that rule, the last divide-reduce woudl seem to be 0.5 / 3 = 0.1667 but instead it appears to have change operator from divide to multiply as 0.5 x 3 = 1.5.
[40:04] “when i say we’re doing things right-to-left I’m only talking about functions”
[40:57] “the rules are different for operators but […] all functions […] go right-to-left”
In trying to clarify this, I did find the following Syntax Rules interesting:
Functions have long right scope : takes as its right arguments everything to their right.
Dyadic functions have short left scope : takes as its left arguments the first piece of data to its left.
Operators have long left scope : takes as its left operand the longest function to its left.
[Edit:] Reviewing the videos again…
I see the order of evaluation for the Slash Operator is explained clearly here (this just didn’t hook in my brain the first time through - maybe I was watching too late)
Trying to understand the apparent different evaluation direction between:
Reduce “/”
R is an array formed by applying function f between items of the vectors along the Kth xis of Y.
Scan “\”
R is an array formed by successive reductions along the Kth axis of Y.
I’ve a tentative notion that one way to think about this is that
functions go right-to-left
operators go left-to-right.
For example…
the Reduce Operator moves left-to-right inserting the function between all elements, and only after insertions completed, the functions are evaluated right-to-left.
the Scan Operator moves left-to-right inserting the function once, then evaluates that function right-to-left. With that result, the operator moves right inserting another single function.
Or left-to-right is just for the Scan Operator? [I’ll come back to update this when I learn more]
Yes, it’s operating on successively larger subarrays, from left-to-right. It’s a different concept to either how multiple functions are parsed or how multiple operators are parsed.
This I believe is just
1: dyadic result 0.5
2: monadic 3 divided into previous result i.e. 1/3
3: dyadic 4 divided in to previous result
4: monadic 5 = 0.2 divided into .375