#!/usr/bin/env clojure ;; It looks like clojure has become a full citizen of Debian ;; In emacs, a syntax highlighted program can be converted to html with htmlize-buffer, and then if ;; you top and tail that and copy it to blogger it comes up nicely. And this seems to still be ;; working after all this time ;; So here is my first published clojure program for a while... ;; If you're using Debian 11, you can run it by installing clojure with ;; $ sudo apt install clojure ;; saving this file as test.clj ;; and then in a terminal window making the file executable ;; $ chmod +x test.clj ;; and then running it ;; $ ./test.clj (println "hello") (defn factorial [n] (if (< n 1) 1 (* n (factorial (- n 1))))) (println '(factorial 10) (factorial 10)) ;; If all is working then you should see something like ;; $ ./test.clj ;; hello ;; (factorial 10) 3628800
Blog Archive
-
▼
2021
(11)
-
▼
December
(11)
- Clojure Setup from Scratch on a Clean Install of D...
- Fermat's Christmas Theorem : Fixed Points Come In ...
- Christmas Theorem: Some Early Orbits
- Chrismas Theorem: Automatic Windmills
- Christmas Theorem: Principled Windmills
- Fermat's Christmas Theorem: Windmills
- A Festive Theorem
- A test program
- Emacs, even
- Clojure Shell Scripts on Debian
- Hello Again World (2nd December 2021) Setting Up C...
-
▼
December
(11)
Search This Blog
Thursday, December 2, 2021
A test program
Subscribe to:
Post Comments (Atom)
Having trouble following...
ReplyDeleteSo, Clojure is available in Debian 11 stable via apt? Did previous versions of Debian not have clojure available?
P.S. What version of Clojure does Debian 11 come with?
Thank you!
Clojure's available through apt, it kind of always was but it used to be quite out of date so I always had to install the latest version by hand. I didn't need to bother this time since the apt version is 1.10.2 which is pretty current.
ReplyDeleteMore importantly from my point of view, and this is new since last time I looked, you can just write a program as a script in the usual manner with a shebang, like you can with most other languages that are happy citizens of unix.
There's a start up delay of about 2 seconds, but that's the only thing that makes you think you're not just using a nice normal language.