Forum Discussion
Formula Challenge: Create a guitar fretboard diagram
This solution (first solution) reads very well. The consistency in the parameter names really helps me follow the parameter pass between functions. I played with changing the numbers in the ArrConst and sure enough the result still produces perfect blocks of numbers no matter the order.
I see the alternative solution has some similarities to the first one but differs in delivering the solution in 'Rubik'. I prefer the first solution because I think it reads a bit better and its version of 'Rubik' is very clean. I'm still trying to grasp the full potential of REDUCE and going beyond the limited notion I had of the function that can 'merely return a scalar'. REDUCE seems to be a cut above the other Lambda helper functions. Perhaps it wouldn't be as useful if the array of arrays limitation was lifted but it's very powerful.
I would consider the failure of SCAN, BYROW, BYCOL to generate nested or stacked arrays to simply be a gross failure in the original specification. It should have been obvious that the majority of applications of such functions requires arrays of arrays. The exceptions are when one is calculating (i) a single value such as a grand total, (ii) a 1D row or column vector, (iii) a homogeneous 2D matrix, typically using array operations such as MMULT.
REDUCE only aims at producing a terminal value so it is capable of processing a 2D array, column by column. The use of HSTACK, is an effective workaround to make REDUCE return the result that SCAN should have generated by default.
What it does not achieve, (see attached) is to provide support for the case that one uses array methods to simplify calculation, not add complexity!