practicalli / practicalli/clojure

`def` caching results

Open
#51 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

clojure-core
Dominant language
Makefile
Stars
117
Forks
36
PR merge metrics
No merged PRs in 30d

Description

The first time the def function is called it will cache the results. This makes the call quite efficient in subsequent times.

This can cause confusion if you expect the def value to change, for example

(def not-random (rand-int 1000))

When the repl is restarted or cleared of the def, then the next evaluation of the def expression will generate the value again.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no documentation file or test, so first confirm where this explanation belongs and what change is wanted. Reproduce the def example in the Clojure REPL, then consider the work complete when the caching behavior and reset or re-evaluation case are documented in the agreed location.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.