Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My pleasure, hope they serve you well.


Cool, I started doing these a couple of years ago, nice to have an updated version. I haven't done lisp in a long time but I'm trying to get back into CL.

One question: using SBCL I can run the script with sbcl --script contemplate.lisp but how do I load the koans into the repl in a way that has all the helper/test functions available? If I just (load "test-framework.lisp") or do sbcl --load contemplate.lisp, I get a bunch of warnings and things like (assert-equal t t) throw "undefined function". It's mentioned in the original PR that this "should" be possible now but I didn't see it in the README.

One thing I'm very not familiar with yet is the quicklisp/abcl and packaging system so this is probably very obvious. Thanks!


Hmmm. Koans in the original form will warn because they are incomplete, so loading them altogether is going to not work very well. I don't think that the current version of koans is very well-suited for interactive development; please feel free to open an issue for that and perhaps it will get done someday.


Okay cool, I can just eval the actual code separately from the koan test framework for now, it's fine. Sounds like an interesting problem for the reader for sure. :)

edited with suggestion to call use-package I'm not very familiar with the lisp packaging stuff yet.

Here's what I was trying to do:

  * (load "test-framework.lisp")
  T
  * (use-package :lisp-koans.test)
  T
  * (assert-equal t t)

  debugger invoked on a UNBOUND-VARIABLE in thread
  #<THREAD "main thread" RUNNING {1001570143}>:
  The variable LISP-KOANS.TEST::*KOAN-ASSERT-LIST* is unbound.
Aha it looks like it's part of the code that is testing for blanks in the original form.

  (if (form-contains-blanks-p form)
      (push :incomplete *koan-assert-list*)
That seems like it's fixable, maybe I will open a bug for that. I don't think it expects to run outside of the run-koan function. That's fine, I'll stop there until I know enough to fix it haha.

Also thanks for answering my noob questions! I just realized you also wrote the Common Lisp Condition System which is on my TO-READ list (after I do about 100 hours of lisp refresher stuff lol).


Yes, none of this expects to be run outside of the standard koan run. Sorry about this; please open an issue and eventually I'll patch this code to be runnable outside of the koans file.


For that, you should be able to load the test framework and the koan helper file separately. Then try to evaluate individual koans in emacs/slime - it should work.


Oh! I see now! You're not using the LISP-KOANS.TEST package.

(use-package :lisp-koans.test) and you should be good to go.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: