elisp-koans icon indicating copy to clipboard operation
elisp-koans copied to clipboard

koans are broken (mostly from switch from cl to cl-lib I think)

Open bo-tato opened this issue 2 years ago • 2 comments

thanks for these koans, they're really helpful to get started, makes emacs lisp a lot less intimidating and I feel confident to try debugging and editing plugins now :smiley:

At least in emacs 28 to first get the contemplate or run-test to work we need https://github.com/jtmoulia/elisp-koans/pull/20 then in doing the koans I had to edit case equalp subseq first second fourth typep copy-seq concatenate incf loop return evenp floor* multiple-value-list and values to their cl- equivalent.

also in line 63 of vectors.el:

(should-not (aref (list-to-bool-vector '(nil))))

I get error that aref expects two args not one, I changed it to:

 (should-not (aref (list-to-bool-vector '(nil)) 0))

adding second arg of 0 which I think is outside of the code we're intended to edit for that koan

also in cl-loops.el line 115:

      (should (eq ___ (find '("The Hobbit" "Bilbo")) pairs-in-table :test #'equal)))))

after changing it to cl-find I get error that find has too few arguments, I think the paren is misplaced and it should be:

      (should (eq ___ (find '("The Hobbit" "Bilbo") pairs-in-table :test #'equal))))))

If it's just a matter of making those changes I'm happy to edit it all and submit a pull request. But I'm also obviously just starting with emacs lisp so I'm not sure what is best, like I read it is recommended to use the built-in seq.el library that provide a lot of that stuff (find subseq etc) now rather using the cl-lib

bo-tato avatar Feb 22 '23 21:02 bo-tato

Thanks @bo-tato! This would be a good stop-gap measure to be able to complete the koans, but I think you're right that it is worth seeking out the best equivalent elisp idioms.

@jtmoulia If this kind of review would be helpful, I am happy to help, perhaps in collaboration with @bo-tato if they're willing.

stefanv avatar Apr 14 '23 17:04 stefanv

Hi @bo-tato -- I apologize for the late response.

I read it is recommended to use the built-in seq.el library that provide a lot of that stuff (find subseq etc) now rather using the cl-lib

Hm, I think it'd make sense to seq.el in addition to the cl koans, though perhaps with the cl koans being optional given it isn't the preferred approach. Given the cl koans are sprinkled throughout (?) there might be some unraveling to do

jtmoulia avatar Sep 20 '23 00:09 jtmoulia