robpike/ivy

value: binary iota is incorrect

robpike opened this issue · 2 comments

Given

scalar binop vector

the scalar will be promoted to vector; that's how ivy works. But it's not how APL works. It usually doesn't matter, but for binary iota (index) it does. 3 iota 3 should yield 3, not 1. It yields 1 because the LHS becomes 3 3 3.

It's not that simple. The operator technically doesn't accept a scalar on the left.

Needs to be tested and verified better.

The analysis in this issue is incorrect. 3 iota 1 2 3 works fine, honoring the documentation even if tryapl.org says it's a rank error. So closing.