在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:functional-koans/clojure-koans开源软件地址:https://github.com/functional-koans/clojure-koans开源编程语言:Clojure 72.9%开源软件介绍:Clojure KoansThe Clojure Koans are a fun way to get started with Clojure - no experience assumed or required. Follow the instructions below to start making tests pass! Getting StartedI recommend starting from a cloned or forked repo. This way you'll be able to track your progress in Git. You might want to create your own branch - that way if you pull back the latest koans from master, it'll be a bit easier to manage the inevitable conflicts if we make changes to exercises you've already completed. You have a few options for installation:
Instructions for each option are below! Installation on Your MachineThe only things you'll need to run the Clojure Koans are:
Once you've cloned this repo and installed the dependencies, you can run:
to make sure all the dependencies get downloaded properly (and then Installation with VagrantMake sure you have Vagrant and VirtualBox installed. In the root directory of the project, execute:
Installation with DockerOnce you've got Docker installed, you're basically all set. You can run these commands to get started: To run koans:
To start up a REPL:
Running the KoansRun the koans via:
If want to run directly from a REPL, once you are inside the
Either way, it's an auto-runner, so as you save your files with the correct answers, it will advance you to the next koan or file (conveniently, all files are prefixed with the sequence that you should follow). You'll see something like this:
The output is telling you that you have a failing test in the file named
The koans differ from normal TDD in that the tests are already written for you, so you'll have to pay close attention to the failure messages, because up until the very end, making a test pass means that the next failure message comes up. While it might be easy (especially at first) to fill in the blanks making things pass, you should work thoughtfully, making sure you understand why the answer is what it is. Enjoy your path to Clojure enlightenment! Trying more things outIt's very useful to try things out in a REPL (Read-Evaluate-Print Loop) whenever you get stuck or curious. Run:
and you'll be able to type expressions in, and see what output they produce. Here are some interesting commands you might try, once you're in a running REPL: (find-doc "vec")
(find-doc #"vec$")
(doc vec) And if those still don't make sense: (doc doc)
(doc find-doc) will show you what those commands mean. You can exit the REPL with ContributingPatches are encouraged! Make sure the answer sheet still passes
( The file ideaboard.txt has lots of good ideas for new koans to start, or things
to add to existing koans. So write some fun exercises, add your answers to
Please follow the guidelines in http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html for commit messages, and put your code in a feature branch (not master) before making the pull request. This makes patches easier to review. Feel free to contact me (Colin Jones / trptcolin) on Github or elsewhere if you have any questions or want more direction before you start pitching in. Contributorshttps://github.com/functional-koans/clojure-koans/contributors CreditsThese exercises were started by Aaron Bedra of Relevance, Inc. in early 2010, as a learning tool for newcomers to functional programming. Aaron's macro-fu makes these koans clear and fun to use and improve upon, and without Relevance's initiative, this project would not exist. Using the koans metaphor as a tool for learning a programming language started with the Ruby Koans by EdgeCase. LicenseThe use and distribution terms for this software are covered by the Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) which can be found in the file epl-v10.html at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论