

Clojure REPL stores the latest results in *1, *2, *3, exception in *e
source link: https://blog.jakubholy.net/2013/08/24/clojure-repl-stores-the-latest-results-in-1-2-3-exception-in-e/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Clojure REPL stores the latest results in *1, *2, *3, exception in *e
*1
, *2
, and *3
. The last exception that has occured is stored in *e
.Example:
;; Inside lein repl, with the user=> prefix removed and output prefixed with ;; =>
1
;; => 1
2
;; => 2
3
;; => 3
4
;; => 4
(println "results - latest:" *1 "prev:" *2 "oldest:" *3)
;; => results - latest: 4 prev: 3 oldest: 2
;; => nil
(/ 42 0)
;; => ArithmeticException Divide by zero clojure.lang.Numbers.divide (Numbers.java:156)
(println "res" *1 "exception" *e)
;; => res nil exception #<ArithmeticException java.lang.ArithmeticException: Divide by zero>
;; => nil
Notice that
clojure.repl
defines in its namespace some very useful functions and macros such as find-doc
, doc
, source
, apropos
, dir
(prints a sorted list of public vars in a ns; ex.: (dir clojure.repl)
), (root-cause throwable)
- check out their docs at ClojureDocs/clojure.repl.
Are you benefitting from my writing? Consider buying me a coffee or supporting my work via GitHub Sponsors. Thank you! You can also book me for a mentoring / pair-programming session via Codementor or (cheaper) email.
Allow me to write to you!
Let's get in touch! I will occasionally send you a short email with a few links to interesting stuff I found and with summaries of my new blog posts. Max 1-2 emails per month. I read and answer to all replies.
Recommend
-
60
Clojure is a powerful, fun and highly productive language for developing applications and services. The clear language design is supported by a p...
-
44
04 February 2019 Alex Miller Welcome to the annual State of Clojure survey results! Every year we survey Clojure and ClojureScript developers to...
-
28
A fancy Clojure REPL, to get it yourself, do the following: In your .clojure/deps.edn add the following alias: :aliases {:repl {:extra-deps {com.bhauman/rebel-readline {:mvn/version "RELEA...
-
14
20 February 2020 Alex Miller Ten years ago, Chas Emerick ran the first State of Clojure survey. In 2010, most users had been using Clojure for just weeks or months, and few were us...
-
20
clj-java-decompiler You can read the motivation behind clj-java-decompiler and the usage example in the blog post .
-
8
Easy Clojure, Easy REPL Dec 9, 2018 • Yehonathan Sharvit Have you ever tried to convince a friend that Clojure is a great language? Have you ever tried to convince your...
-
21
Will online stores ever beat real ones? + Survey results of what customers think Ecommerce shopping has grown significantly in 2020, and many companies are questioning if it will replace the need for brick-and-mortar retail. Wh...
-
8
Clojure世界:使用rlwrap增强REPL 浏览:1236次 出处信息 Clojure的REPL非常方便,可以随时随地试验你的想...
-
7
Java/Spring App Troubleshooting on Steroids with Clojure REPL February 1, 2019 (Published originally at the
-
6
How to Set JVM Memory for Clojure REPL in Emacs (clojure-jack-in, clojure-swank) June 30, 2012 How to increase heap size...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK