I’m not sure if this is due to some fix since version 23.01.01, or something more subtle. The following code for the Series
exercise passes all tests when I run it locally:
: slices \ s n -- a[s]
>r [1] s:/ ( "" a:join a:push ) a:new r> 1 a:reduce+ ( "" = not ) a:filter
;
But it throws an exception on the test runner:
We received the following error when we ran your code:
test-words.8th
series.8th
series-tests.8th
Exception: Expected Array but got Number: at line 4 byte 72 in series-tests.8th ← user:slices: task REPL
Inserting .s
in various places (in the code editor) seems to show that the stack is correct at the time of the a:reduce+
word. And the placing .s
after a:reduce+
doesn’t show the stack, so that must be where the exception is thrown. That makes me think it’s a bug in 8th itself, perhaps, but maybe I’m missing something.