JohnEarnest / ok

An open-source interpreter for the K5 programming language.
MIT License
587 stars 72 forks source link

"outer product each" doesn't work #24

Closed ngn closed 9 years ago

ngn commented 9 years ago

Repro:

 a:(!3;!4)
(0 1 2
 0 1 2 3)
 a*/:\:'a
invalid arguments to ' [(0 1 2
 0 1 2 3)  */:\: (valence 1), (0 1 2
 0 1 2 3)]

I was expecting:

((0 0 0
  0 1 2
  0 2 4)
 (0 0 0 0
  0 1 2 3
  0 2 4 6
  0 3 6 9))
JohnEarnest commented 9 years ago

Seems to have just been a missing case in the adverb dispatch table. Apparently I've never exercised an expression of that form before.

ngn commented 9 years ago

Indeed it's an obscure case. Thanks for the quick fix.