Once added to your .emacs file, you can call it with:
M-x clojure-update-ns
It assumes clojure-mode is already loaded.
A piece of intertube about the Clojure programming language, algorithms and artificial intelligence.
M-x clojure-update-ns
M-x earmuffyto add earmuffs, or type
C-u M-x earmuffyto remove them.
| Ada Type | Description | C Equivalent |
|---|---|---|
| Character | A single character | char |
| Integer | An integer (32-bit) number | int |
| Natural | Zero or positive integer | - |
| Positive | A positive integer | - |
| Long_Integer | A big integer (same as long in Gcc) | long (same as int in Gcc) |
| Long_Long_Integer | A really big (64-bit) integer | long long |
| Short_Integer | A small (16-bit) integer | short |
| Short_Short_Integer | A really small (8-bit) integer | char |
| Float | A real number | float |
| Long_Float | A big real number | double |
| Long_Long_Float | A really big real number | long double |
| Short_Float | A smaller real number | ? |
| Fixed | A fixed-point real number | - |
| String | An Ada fixed-length string | char array |
type Speed is new Long_Float; Speedy_Gonzales_Speed : Speed;
X : Long_float := 300.0; Speedy_Gonzales_Speed := X;The compiler effectively gives an error:
expected type "Speed" defined at line 6
found type "Standard.Long_Float"
subtype Degree is Long_Float; Oven_Temperature : Degree; Y : Long_Float := 255.0; Oven_Temperature := Y;
type Degrees is new Float range -273.15 .. Float'Last;
type money is delta 0.01 digits 18;Ada also supports multidimensional arrays, bit-level memory access, definition of memory pool, concurrency programming in a task-oriented way, object-oriented programming, generic packages etc.
;; in Scheme: > (rational? (/ 1 5)) #t > (rational? 3) #t > (real? 3) #tWhile this discussion may not make so much sense for dynamic languages such as Clojure, I think new languages being designed, which are not dynamically typed, could really benefit of having such rich primitives types. A complex type systems like the one from ML or Haskell is not needed for this purpose and primitives types is the most basic and most used feature of a programming language, so dear languages designers, next time, have a small thought for Ada.
(ns `(let* ((nsname '())
(dirs (split-string (buffer-file-name) "/"))
(aftersrc nil))
(dolist (dir dirs)
(if aftersrc
(progn
(setq nsname (cons dir nsname))
(setq nsname (cons "." nsname)))
(when (or (string= dir "src") (string= dir "test"))
(setq aftersrc t))))
(when nsname
(replace-regexp-in-string "_" "-" (substring (apply 'concat (reverse nsname)) 0 -5))))`
(:use $1)
(:require ))
(ns mylib.utils.swing-stuff (:use ) (:require ))
(when-let [something (get-something arg1 arg2)] (do-stuff something))
(let [something (get-something arg1 arg2)] (when something (do-stuff something)))
(defmacro when-nlet [bindings & body] (when (not= (count bindings) 2) (throw (IllegalArgumentException. "when-nlet requires an even number of forms in binding vector"))) (let [form (bindings 0) tst (bindings 1)] `(let [temp# ~tst] (when (not (nil? temp#)) (let [~form temp#] ~@body)))))
(when-nlet [val1 (get-something arg1 arg2)] (when-nlet [val2 (get-something2 val1)] (when-nlet [val3 (get-something3 val2] (do-stuff val1 val2 val3))))
(when-nlet* [val1 (get-something arg1 arg2)
val2 (get-something2 val1)
val3 (get-something3 val2)]
(do-stuff val1 val2 val3))
(defmacro when-nlet* [bindings & body] (when (not (even? (count bindings))) (throw (IllegalArgumentException. "when-nlet* requires an even number of forms in binding vector"))) (let [whenlets (reduce (fn [sexpr bind] (let [form (first bind) tst (second bind)] (conj sexpr `(when-nlet [~form ~tst])))) () (partition 2 bindings)) body (cons 'do body)] `(->> ~body ~@whenlets)))
((when-nlet [val3 (get-something3 val2)]) (when-nlet [val2 (get-something2 val1)]) (when-nlet [val1 (get-something arg1 arg2)]))
(when-nlet [val1 (get-something arg1 arg2)]
(when-nlet [val2 (get-something2 val1)]
(when-nlet [val3 (get-something3 val2)]
(do (do-stuff val1 val2 val3)))))
(domonad maybe-m [val1 (get-something "a" "b")
val2 (get-something2 val1)
val3 (get-somnil val2)]
(do-stuff val1 val2 val3))
(defmacro when-nlet* [binding & body] (let [body (cons 'do body)] `(domonad maybe-m ~binding ~body)))
(defproject henley "1.0.0-SNAPSHOT"
:description "A GUI for a text generator similar to the one
in the book Ansi Common Lisp, Paul Graham"
:dependencies [[org.clojure/clojure "1.2.0"]
[org.clojure/clojure-contrib "1.2.0"]
[henley/henleyuicomponents "1.0.0-SNAPSHOT"]]
:dev-dependencies [[swank-clojure "1.2.0"]
[lein-run "1.0.0-SNAPSHOT"]]
:main henley.core
)