>> Home / tutorial / learning, lisp
∵ Mari-chan ∴ 2022-04-19 ∞ 3'
Can I learn this while having skipped a huge part of chapter 1 and not resolved a single exercise?
Waait a second! They're using a specific language here. WELL, no one told me what to use so I think I'll just set up Clojure.
Seems like your editor is a huge part of Clojure. I don't think Sublime in its refined simplicity will be able to do this fancy stuff... Let's see, their thing is called REPL (read eval print loop), a friend showed me the concept and honestly, I really liked it. I bet is very CPU intensive though and can't really understand how complex systems would keep this going... But maybe, the whole point of Lisp is that it never gets complex? That'd be very magical though.
Wow, this little tool is so powerful, so here's what you should do to get it running on your Sublime:
Package Control: Install Package
→ Clojure Sublimed
View
→ Syntax
→ Open all with current extension as...
→ Clojure Sublimed
→ Clojure (Sublimed)
.~/.clojure/deps.edn
:
:aliases {:nREPL {:extra-deps {nrepl/nrepl {:mvn/version "0.9.0"}}}}
You can run it like this:
```shell
clj -M:nREPL -m nrepl.cmdline
Clojure Sublimed: Connect
Copy the port you see running on your Shell.And general commands can be found on this Readme.
Most REPL environments support a few tricks to help with interactive use. For example, some special symbols remember the results of evaluating the last three expressions:
*1
(the last result)*2
(the result two expressions ago)*3
(the result three expressions ago)user=> (+ 3 4)
7
user=> (+ 10 *1)
17
user=> (+ *1 *2)
24
(require '[clojure.repl :refer :all])
Makes a bunch of these incantations available.
Not sure what something is called? You can use the apropos
command to find functions that match a particular string or regular expression.
user=> (apropos "+")
(clojure.core/+ clojure.core/+')
And then to look it up in the docs:
user=> (doc doc)
clojure.repl/doc
([name])
Macro
Prints documentation for a var or special form given its name
Okay, that's pretty cool.
Huh, it seems like the book doesn't really translate to Clojure, that's annoying. I might just change to "Common Lisp":
Damn, this is really a technology of the past. All this Lisp installation party mined my interest A LOT. I'll watch the lessons to see if it helps.
Also, I gave up Common Lisp and will use DrRacket now, seems like it's what everyone uses anyway, I shouldn't have tried to get fancy.
The lessons are SOO BORING, god help me.