I am working on creating the exercise for the elisp track. I have noticed some inaccuracies in the canonical tests. For instance, with an input of
1 2 swap
The test is looking for [2,1]. In Forth this would actually return [1, 2].
Obviously the reason is you push 1 and then 2 on the stack. The stack is now [2,1]. Then you swap and get [1,2].
Anyways, just wondering if this should be changed.
If you push 1, 2 the stack is … [1, 2] according to the way we define/represent the stack. This is consistent with all the other tests.
@IsaacG Correct. I guess what I mean is should we match how Forth actually works? If you push 1 2 on the stack. The stack would actually be [2,1] in Forth.
[2, 1] and [1, 2] are the same data represented in two different ways. There’s very little benefits to changing that. The cost of changing that is quite high. I don’t see why we’d change it. See Suggesting Exercise Improvements | Exercism's Docs