在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:google/lisp-koans开源软件地址:https://github.com/google/lisp-koans开源编程语言:Common Lisp 95.0%开源软件介绍:Lisp KoansGetting StartedOne-time MethodFrom a terminal, execute your lisp interpreter on the file 'contemplate.lisp' e.g.
Watching the KoansOn Linux and MacOS systems, the shell scripts
Results of ContemplationRunning on a fresh version should output the following:
This indicates that the script has completed, and that the learner should look to asserts.lisp to locate and fix the problem. The problem will be within a define-test expression such as ;;; In order to progress, fill in the blanks, denoted via ____ in source code.
;;; Sometimes, you will be asked to provide values that are equal to something.
(define-test fill-in-the-blanks
(assert-equal ____ 2)
(assert-equal ____ 3.14)
(assert-equal ____ "Hello World"))
;;; Sometimes, you will be asked to say whether something is true or false,
;;; In Common Lisp, the canonical values for truth and falsehood are T and NIL.
(define-test assert-true
(assert-true ____))
(define-test assert-false
(assert-false ____)) In this case, the test is incomplete, and the student should fill in the blank (____) with appropriate lisp code to make the assert pass. In order to test code, or evaluate tests interactively, students may copy and paste code into the lisp command line REPL. TestingTo test the koans, execute your lisp interpreter on the file 'contemplate.lisp' e.g.
Quoting the Ruby Koans instructions"In test-driven development the mantra has always been, red, green, refactor. Write a failing test and run it (red), make the test pass (green), then refactor it (that is look at the code and see if you can make it any better). In this case you will need to run the koan and see it fail (red), make the test pass (green), then take a moment and reflect upon the test to see what it is teaching you and improve the code to better communicate its intent (refactor)." ContentThe Common Lisp koans are based on the Python koans and Ruby koans projects. Additionally, many of the tests are based on new material that is special to Common Lisp. Note that the unit on threads uses bordeaux-threads and bt-semaphore. The user must have Quicklisp installed and loaded or a reader macro will remove the instructions to run :threads. For information and instructions on installing Quicklisp please see: https://www.quicklisp.org/beta/ The user can either remove #+quicklisp and uncomment (load "~/.quicklisp/setup.lisp") in threads.lisp, or if they know quicklisp will be loaded while running contemplate.lisp do nothing. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论