Fork me on GitHub
#beginners
<
2021-04-15
>
Thomas16:04:56

Is there a way to see the code behind default functions like map, reduce, etc? I'm coding in visual studio code with the calva Getting Started REPL. Please explain like I'm five, if at all possible, because I am not only new to Clojure, but to programming in general. Thanks for any help. My goal is to adapt map so that it returns a set instead of a list. I am doing a task from Brave Clojure.

borkdude16:04:37

@oyvind.holt In the REPL, you can type (source map) and it will print the source of the clojure.core map function. But quite possibly you can also navigate to its definition in Calva (depending on your project setup).

Thomas16:04:08

Thanks, Bork. I'll try that.

borkdude16:04:33

You can also just navigate here https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj and search for things like "defn map"

Thomas16:04:46

Do you know how I navigate to the relevant REPL in VSC? I tried in what's called the output.calva-repl, but that doesn't seem to work. I'm very, very green.

Thomas16:04:12

Alright, thanks

pez16:04:46

@oyvind.holt , in VS Code there are commands for both peek and goto definition. The command palette is your friend. These features are also available via hovering with the mouse and pressing cmd/ctrl.

Thomas17:04:09

@pez Appreciated, søta bror 🙂

❤️ 3
marcosemanuelss19:04:42

Hello guy! My name is Marcos Emanuel. I'm software developer and I'm starting in the clojure world. ✌️

👋 95
3
clojure-spin 24
3
🍺 3
2