Description
This issue describes how to implement the protocols
learning exercise for the Clojure track.
Getting started
Please please please read the docs before starting. Posting PRs without reading these docs will be a lot more frustrating for you during the review cycle, and exhaust Exercism's maintainers' time. So, before diving into the implementation, please read up on the following documents:
Please also watch the following video:
Goal
The goal of this exercise is to teach the student how protocols are used in Clojure.
I have an idea for this that I could be part of a really killer mini-syllabus: The student would build a tiny mathematics library, learning concepts by writing functions to solve equations.
Learning objectives
This was inspired by Emmy, a Clojure computer algebra system: https://github.com/mentat-collective/emmy
One of Clojure's criminally (imo) underused domains is mathematics. This is a bit perplexing, because the ability to write mathematical expressions in a language based so strongly on such expressions is something that, to a mathematician, ought to be irresistible.
I'd like to use Clojure to do what Grant Sanderson (3blue1brown) does with Python in the world of maths exposition.
The emmy system is based heavily on protocols, which likely serves as an appropriate entry-point. The idea is to produce a library we'll codename "emmy-lite". Where emmy itself is designed for performance, ours will be designed for education.
Out of scope
Concepts
protocols
Prerequisites
basics
Resources to refer to
https://clojure.org/reference/protocols
Also check out https://github.com/Sophia-Gold/symbolic-algebra (also based on protocols!)
Representer
Analyzer
The Clojure Analyzer is currently being implemented and contributions are welcome.
Implementing
To implement a concept exercise, the following files must be created:
languages
└── clojure
└── exercises
└── concept
└── <SLUG>
├── .docs
| ├── instructions.md
| ├── introduction.md
| ├── hints.md
| └── after.md (optional)
├── .meta
| |── design.md
| └── Example.clj
├── <NAME>.clj
└── <NAME>_test.clj
Help
If you have any questions while implementing the exercise, please post the questions as comments in this issue.