uiua-lang / uiua

A stack-based array programming language
https://www.uiua.org
MIT License
1.53k stars 107 forks source link

Add size checking to `table` inputs > 2 #468

Closed bkDJ closed 3 months ago

bkDJ commented 5 months ago
⧻♭ ⊞+. ⇡1e4       # errors because 1e8 is too big
⧻♭ ⊞(+++)... ⇡1e2 # would also be be 1e8, but does not error
kaikalii commented 5 months ago

Unfortunately, I don't know a good way to do this accurately with the way table is implemented. The output size for that instance of table is not known ahead of time.

bkDJ commented 5 months ago

Ah, darn. I hadn't looked at the implementation and was hoping the change would be something simple like "gather all argument shapes, reduce multiply, multiply by number of function signature outputs, assert less than limit" but I suppose that would only work if there are no boxed values and table can see function output count… Thanks for looking into it.

bkDJ commented 3 months ago

Mostly fixed as of e3756b5c5c35c1b0551dfc660c4e3c73b1052e74 ❤️