The Clojure documentation, under "Reader", gives a list of characters
allowed in a symbol name. The characters, <, >, and = are not
included in this list. How is it then that <, <=, >, >=, =, etc. are
symbols? (I assume they are symbols because I can write (< 3 4),
etc.)
--~--~-~--~---
I'm in the process of learning Clojure, and I ran across something
that other newbies like me may find useful. The question I had was
this: how does one get a method name into a macro? Consider the
following code:
(defmacro foo [x] `(. Character (isWhitespace ~x)))
Yes, I know that this woul
I have more information on this now, and it is definitely a bug in
Clojure -- defmacro within a let doesn't work correctly. Consider the
following file:
--- BEGIN foo1a.coj ---
(ns com.ksvanhorn.foo1a)
(let [dummy 0]
(defmacro add [& args] `(unchecked-add ~...@args))
(defmacro mul [& args]
Here's how I implemented the ">>>" operator for ints:
(let [intmask (dec (bit-shift-left 1 32))]
(defmacro ushr [x n] `(int (bit-shift-right (bit-and ~intmask ~x)
~n
The (bit-and intmask x) expression effectively gives you the unsigned
equivalent of x. For bytes, use 255 instead of intmas