Skip to content

Exercism Challengesλ︎

Exercisim Clojure Track icon

🌐 Exercism Clojure Track

🌐 Exercism is a learning platform for multiple programming languates (currently 67) which combines carefully crafted coding challenges and mentors who review and advise on solutions.

Solve challenges via the built-in Exercism editor.

Exercism Clojure Editor

Or download each exercise locally using the 🌐 Exercism CLI, providing a 🌐 Clojure CLI configured project with a test runner.

Use the 🌐 Exercism CLI to submit a solution for metor feedback.

Exercism embdedded Clojure editor

The Exercisim Clojure editor is powered by babashka/sci

Clojure Trackλ︎

All the challenges are groups into specific 🌐 language tracks, including the 🌐 Clojure track

Join the language track to be presented with available challenges and progress through that specific track.

Clojure code challenges - Exercism Clojure track

Working Locallyλ︎

🌐 Exercism Guide to working locally

Follow the Practicalli Clojure CLI Install steps (Exercism includes a similar 🌐 Clojure CLI install guide)

The 🌐 Exercism CLI can download a Clojure project containing the code for a specific challeng and submit the code back to exercism to confirm if the tests have passed and complete the challenge (or get feedback from a mentor).

Each challenge shows the download and submit commands

Each Exercise page shows the command to download the code for that specific exercise, which is of the form

exercism download --exercise=exercise-name --track=clojure

Open the project source code downloaded from Exercism in a preferred Clojure editor and write a solution to solve the exercise.

clojure -X:test command in the root of the downloaded project will run the tests supplied by the exercise

Practicalli Test Runner aliases

clojure -X:test/run runs the Kaocha test runner from the Practicalli Clojure CLI Config

clojure -X:test/watch will automatically re-run tests when file changes are detected.

Clojure test runner covers test runner options in more detail.

Once the tests pass and you are happy with the solution, submit it to the Exercism website

exercism submit /path/to/src-file

REPL Workflowλ︎

Use a REPL workflow to get instant feedback on code written to make the unit test assersions pass.

Start a REPL via a Terminal UI in the root of the Exercism project

clojure -M:repl/rebel

Open the project in a Clojure aware editor and connect to the REPL process.

Open the project in a Clojure aware editor and start a Clojure REPL, e.g. jack-in

Use a rich comment to experiment with clojure expressions that help move towards a solution, typically solving one unit test at a time. This separates experimental code from finished designs.

(comment 
  ;; experiment with clojure code 
  ;; evaluate expressions in the Clojure editor
  ;; and see the evalaution results inline
)

Disable Linter rules

Disable Linter rules within the comment expression that are not useful for REPL experiments.

It is common to have several implmentations of a function with the same name, so :redefined-var is disabled.

Functions defined in the REPL experments are not ment to be used publicly (until they are copied/moved out of the comment form), so :clojure-lsp/unused-public-var lint rule is disabled

#_{:clj-kondo/ignore [:redefined-var :clojure-lsp/unused-public-var]}
(comment
  ,,,
)

Supportλ︎

Mentors on the Exercism website will provide a review of your submissions and you can switch between mentor and practice modes as you prefer.

practicalli/exercism-clojure-guides contains a design journal of solutions to several Clojure exercises.

Ask for advice in the #exercism or #beginners channels of the Clojurians Slack community.