[J3] [EXTERNAL] Re: Limitations of SELECT RANK?
Steidel, Jon L
jon.l.steidel at intel.com
Tue Oct 20 12:21:17 EDT 2020
Tom wrote:
We are seeing that common use cases for SELECT RANK have duplicate text. Aside from generic resolution, there are also cases involving whole array arithmetic. For these cases, the shorthand in my example is not just convenient for the coder, but is also a means to reduce errors that can happen when a subsequent change is only propagated to a subset of the RANK clauses. Granted, this is the weakest case of code duplication, as the duplicates would all line up next to each other in a single file.
End Tom
While there may be use cases that have duplicate text in multiple SELECT RANK case blocks, many involving whole array arithmetic, the code generated for each of the blocks is very different due to the difference in the array ranks between the two blocks. The compiler would have to replicate the block for each possible rank and generate a separate block for each rank. The ranks specified in the rank selector would need to be constant for this to happen, they could not be variable or values evaluated at runtime.
-jon
More information about the J3
mailing list