practicalli / practicalli/clojure
Clarifying what a function is
Nobody has claimed this yet.
- Dominant language
- Makefile
- Stars
- 117
- Forks
- 36
- PR merge metrics
- No merged PRs in 30d
Description
A function is an Object implement IFn, which includes an invoke method, when clojure compiles (f x) it looks for the invoke method on f, and compiles code calling that method on x
This is important because methods do not exist as first class values (you can use reflection to get method handles, but those still are Objects standing for a method in a reflective context).
A function can be passed as an argument because it's an object, you can't pass a method as an argument, because it isn't, it has no standalone existence apart from the object it belongs to.
https://clojurians.slack.com/archives/C053AK3F9/p1594051506138400
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test is named. Start by locating the documentation that defines or explains functions, then review the issue text and linked Clojurians discussion for the intended clarification. Done means the documentation distinguishes function objects and invocation from methods and explains why functions can be passed as arguments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100