You cannot post messages because only members can post, and you are not currently a member.
Description:
Discussion of the Clojure programming language
|
|
|
Problem w/ daemon threads
|
| |
Hi all,
I'm trying to get a periodic daemon thread working. I've read some of
the stuff here:
[link]
With no luck. My code looks like this
(defn daemon
"Creates a new daemon thread and sets runnable to f"... more »
|
|
Strange behavior seen when ints have leading zeros
|
| |
C:\dev\clojure>java -cp clojure.jar clojure.lang.Repl
Clojure 1.1.0-alpha-SNAPSHOT
user=> (def grid1 [01 02 03 04 05 06 07])
...user=> grid1
[1 2 3 4 5 6 7]
user=> (def grid2 [01 02 03 04 05 06 07 08])
java.lang.NumberFormatExceptio n: Invalid number: 08
java.lang.Exception: Unmatched delimiter: ]... more »
|
|
Datatypes and Protocols - early experience program
|
| |
An early version of the code for a few important new language
features, datatypes[1] and protocols[2] is now available in the 'new'
branch[3]. Note also that the build system[4] has builds of the new
branch, and that the new branch works with current contrib.
If you have the time and inclination, please try them out. Feedback is... more »
|
|
Unified string/keyword/symbol Library
|
| |
I often have to manipulate keywords and symbols. A symbol name needs
a string appended in a macro, a keyword uses underscores instead of
dashes.
In order to do this, I usually transform them into a string, do some
manipulation, and then turn the result back into a keyword/symbol.
This pattern shows up enough that I created the multimethod below... more »
|
|
Clojure CSV Library
|
| |
Hi everyone. I wrote a CSV parsing and output library for my own uses
when I didn't see another one available. Someone on #clojure suggested
it might be of general interest for clojure.contrib. If you guys
agree, I'm happy to do whatever is necessary to assist with that.
The code is at [link] . I'm happy... more »
|
|
Topological sort
|
| |
Hi,
I've been trying to implement a topological sort and have been
struggling a bit. I have a map of symbol vs collection of symbols
like:
{a [b c], b [c], c [nil]}
which can be read as 'a' depends on 'b' and 'c', 'b' depends on 'c'
and 'c' doesn't depend on anything. I've been trying to write... more »
|
|
clojure event handling
|
| |
I'm curious what the best idiomatic way of handling events is (e.g.
receiving a series of messages and dispatching functions on the basis
of the messages). One could use the 'experimental' add-watch(er)
functions. But it might also be nice to do something stream-oriented,
e.g. a doseq on a stream of events. But the trouble is this dies as... more »
|
|
clojure vim shebang
|
| |
Hi all,
Does anyone know why if the first character in my *.clj file is '#', then
when I open it in VIM, ClojureVIM fails to recognise it as a Clojure file?
Thanks
-John
|
|
Language request: make key and val work on vector pairs too
|
| |
Clojure 1.1.0-alpha-SNAPSHOT
user=> (conj (first {1 2}) 3)
[1 2 3]
user=> (conj {1 2} [2 5])
{2 5, 1 2}
user=> (key (first {1 2}))
1
user=> (key [1 2])
java.lang.ClassCastException: clojure.lang.PersistentVector cannot be
cast to java.util.Map$Entry (NO_SOURCE_FILE:0)
In all respects but one, two-sized vectors act like map entries, and... more »
|
|
How to write a macro
|
| |
Hi all,
I'm looking for a way to write a defkw macro so that (defkw ABSENT) expands
to
(def ABSENT (kw "ABSENT" :ABSENT )).
Thanks,
-John
|
|
|