On 02.03.2009, at 01:50, Rich Hickey wrote:
I was wondering if you considered using maps or struct-maps for this.
One of my pet peeves with algebraic data types is the unnamed,
positional nature of the components/fields. It always bothers me you
have to rename the fields in every pattern
Over the last weeks, two additions to clojure.core broke several of
my library modules by introducing names into the clojure.core
namespace that I was using in my libraries as well. While this kind
of problem is acceptable in a pre-release development period, I don't
expect it to go away
hello,
there are lots of good examples of clojure macros on the web, but i
miss a more detailed explanation.
for example what do all these special characters used inside macros
really mean ` ' @ ~ # ~...@.
anyone know if there's a tutorial for clojure macros (not lisp)?
macros are very exotic for
Hi,
Am 02.03.2009 um 06:06 schrieb max3000:
Here is the code that gave me trouble:
(map #(add-watch % watcher callback-fn) all-agents)
This was not executing. I had to change it to the below expression:
(doseq [agent all-labor-agents]
(add-watch agent total-labor-agent
On Mar 2, 1:16 am, MikeM michael.messini...@invista.com wrote:
Not sure if I understand what you need, but could you build on the
existing capability to send to the current agent: (send *agent* ...) ?
You could have the agent send to itself, then exit the function with
some work left to do
On Mar 1, 10:58 pm, Rich Hickey richhic...@gmail.com wrote:
On Mar 1, 2009, at 1:53 PM, Anand Patil wrote:
I've made futures use the Agents' CachedThreadPool, which should
prevent the thread pool exhaustion (svn 1316). You shouldn't worry
about the expense of the threads, that's why
Thanks for the link, Mark. I'll look into the contents.
What I'm talking about, though, is not that there is no documentation,
but rather I can't find my way around it very well. I only get around
to Clojure every so often and I find I forget a lot, so I'd have to go
through practically all the
Hello,
Martin DeMello a écrit :
Playing with readFileToByteArray in the repl:
user= (import '(org.apache.commons.io FileUtils))
nil
user= (def dawg (FileUtils/readFileToByteArray words.dawg))
java.lang.ClassCastException (NO_SOURCE_FILE:10)
user= (FileUtils/readFileToByteArray
Ah, I see. Out of curiosity, is there some design reason why clojure
doesn't reduce my original function to the apply version? I mean,
take the function:
(loop [x '(1 2 3) fin '()]
(if x
(recur (cdr x) (concat fin (list x)))
fin))
Will, at least if I'm interpreting your responses
now i've found an interesting article that describes macros in more
details http://www.ociweb.com/mark/clojure/article.html#Macros
On 2 Mar, 10:27, linh nguyenlinh.m...@gmail.com wrote:
hello,
there are lots of good examples of clojure macros on the web, but i
miss a more detailed
On Mar 2, 2009, at 5:15 AM, Anand Patil wrote:
On Mar 1, 10:58 pm, Rich Hickey richhic...@gmail.com wrote:
On Mar 1, 2009, at 1:53 PM, Anand Patil wrote:
I've made futures use the Agents' CachedThreadPool, which should
prevent the thread pool exhaustion (svn 1316). You shouldn't worry
Does Clojure have an analog of Lisp's MEMBER function?
(member 'a '(c a f e b a b e)) = (A F E B A B E)
(I'm more interested in it's use as a predicate rather than the fact
that it returns a sublist when true.)
find and contains? are listed under the Maps section of the data
structures page
Hi David,
I think part of the problem is that you missed the name space from the data
you retrived with find-doc. meta isn't in the user namespace so you need to
specify it.
user= (find-doc metadata)
...
-
*clojure.core/*meta
([obj])
Returns the metadata of obj,
Hi David,
Am 02.03.2009 um 13:54 schrieb David Sletten:
Does Clojure have an analog of Lisp's MEMBER function?
(member 'a '(c a f e b a b e)) = (A F E B A B E)
I don't know the member function of CL, but I interpret
your example, that it cuts away the head of the list until
the first
On Mar 2, 2009, at 3:39 AM, Meikel Brandmeyer wrote:
Does Clojure have an analog of Lisp's MEMBER function?
(member 'a '(c a f e b a b e)) = (A F E B A B E)
I don't know the member function of CL, but I interpret
your example, that it cuts away the head of the list until
the first
On Mon, Mar 2, 2009 at 6:54 AM, David Sletten da...@bosatsu.net wrote:
Does Clojure have an analog of Lisp's MEMBER function?
(member 'a '(c a f e b a b e)) = (A F E B A B E)
(I'm more interested in it's use as a predicate rather than the fact
that it returns a sublist when true.)
find
Hi Tom
On Mon, Mar 2, 2009 at 3:13 PM, Tom Ayerst tom.aye...@gmail.com wrote:
Hi David,
I think part of the problem is that you missed the name space from the data
you retrived with find-doc. meta isn't in the user namespace so you need to
specify it.
I don't think David is having trouble
On Mar 2, 2009, at 4:01 AM, Mark Volkmann wrote:
It's verbose in order to discourage its use since its a linear search.
See the discussion about the contains? function at
http://www.ociweb.com/mark/clojure/article.html#Lists
and http://www.ociweb.com/mark/clojure/article.html#Sets.
Ahh.
On Mar 2, 12:48 pm, Rich Hickey richhic...@gmail.com wrote:
On Mar 2, 2009, at 5:15 AM, Anand Patil wrote:
On Mar 1, 10:58 pm, Rich Hickey richhic...@gmail.com wrote:
On Mar 1, 2009, at 1:53 PM, Anand Patil wrote:
I've made futures use the Agents' CachedThreadPool, which should
On Mar 2, 2:34 pm, Anand Patil anand.prabhakar.pa...@gmail.com
wrote:
On Mar 2, 12:48 pm, Rich Hickey richhic...@gmail.com wrote:
On Mar 2, 2009, at 5:15 AM, Anand Patil wrote:
On Mar 1, 10:58 pm, Rich Hickey richhic...@gmail.com wrote:
If you'll bear with me a bit longer- what if I set
On Mar 2, 3:04 pm, Michael Wood esiot...@gmail.com wrote:
I don't think David is having trouble finding the documentation for
meta. He's complaining that the output of (doc meta) does not tell
you that you need to use (meta (var meta)) instead of (meta 'meta) or
(meta meta).
Something like
Article is a great introduction and reference to clojure.
It could serve as _the_ documentation, maybe even distributed with
clojure itself.
I like the fact that it has right code to txt ratio.
The only things missing is better organization (chapters hierarchy)
and syntax highlight of code.
A test like this in clojure.contrib.test-clojure.evaluation is
currently failing:
user= (eval (list + 1 2 3))
java.lang.ExceptionInInitializerError (NO_SOURCE_FILE:0)
--Steve
smime.p7s
Description: S/MIME cryptographic signature
On Mar 2, 3:29 am, Mark Volkmann r.mark.volkm...@gmail.com wrote:
On Sun, Mar 1, 2009 at 11:06 PM, max3000 maxime.lar...@gmail.com wrote:
Hi,
I find the laziness in clojure very hard to wrap my head around. I
understand the idea and it's probably nice in theory. However, in real
life
On Mon, Mar 2, 2009 at 12:53 AM, Konrad Hinsen konrad.hin...@laposte.netwrote:
Over the last weeks, two additions to clojure.core broke several of
my library modules by introducing names into the clojure.core
namespace that I was using in my libraries as well. While this kind
of problem is
On Mar 2, 2009, at 18:35, srolls wrote:
I think :exclude is what you want
(ns my-ns
(:refer-clojure :exclude [get replace]))
Not quite, as exclude requires me to know what I want exclude.
What I want is exclude everything that wasn't there in version X.Y.
Konrad.
in clojure.contrib.monad expressions handling conditions in the monad
comprehension are generated by:
(defn- add-monad-step
Add a monad comprehension step before the already transformed
monad comprehension expression mexpr.
[mexpr step]
(let [[bform expr] step]
(if (identical? bform
On Sun, Mar 1, 2009 at 11:25 AM, Kearsley Schieder-Wethy
turv...@gmail.com wrote:
However, I'll freely admit that I'm a Java newbie. I get the basic
gist of the language, but find myself stalling when it comes to
finding methods and fields on an object. One thing that I found
myself
In August, I was also struggling with laziness. As I went along my
learning curve,
I realized that much of this fog in my mind came up because I was still
taking mutability of data and side effects as normal by habit.
I had not spliced my thoughts while toggling between Java and Clojure,
something
Hmm, interesting error. After the merge of the lazy branch was
everything ok, so it has to be a recent change.
user= (eval (list + 1 2 3))
java.lang.ExceptionInInitializerError (NO_SOURCE_FILE:0)
user= (eval '(+ 1 2 3))
6
user= (list + 1 2 3)
(#core$_PLUS___243 clojure.core$_plus___...@153f141
On 02.03.2009, at 18:48, Matthew D. Swank wrote:
Why is it necessary to pass a dummy result in the conditional code:
(if (identical? bform :when)
(list 'm-bind `(if ~expr (~'m-result ::any) ~'m-zero)
(list 'fn ['_] mexpr))
...
Why not:
(if (identical?
I felt the same way at first. I think it would help if the group
shared some common, non-mathematical cases, where laziness is helpful.
I've been using multiple resultset-seq to collect together matching
data from different databases and stream it on through some existing
Java code. It is
I read the part of your article (on lists and vectors) that you linked
to in another thread -
In the list section you show the function into and conj as applied to
lists, but these can also be applied to vectors and will return
vectors,
(into [1 2 3] [4 5]) = [1 2 3 4 5]
(conj [1 2 3] 4 5) = [1
On Mon, Mar 2, 2009 at 2:11 PM, MikeM michael.messini...@invista.com wrote:
I read the part of your article (on lists and vectors) that you linked
to in another thread -
In the list section you show the function into and conj as applied to
lists, but these can also be applied to vectors and
On Mar 2, 2009, at 2:52 AM, Zededarian wrote:
Ah, I see. Out of curiosity, is there some design reason why clojure
doesn't reduce my original function to the apply version? I mean,
take the function:
(loop [x '(1 2 3) fin '()]
(if x
(recur (cdr x) (concat fin (list x)))
fin))
On Sun, Mar 1, 2009 at 7:22 PM, Rayne disciplera...@gmail.com wrote:
I've been wishing I had one for a while now, to replace my Haskell
wallpaper ;). Me and blbrown were talking in #Clojure and he suggested
I make this post requesting that if anyone here has skill in image
editing they could
There's also includes? in clojure.contrib.seq-utils.
-Jason
On Mar 2, 6:07 am, David Sletten da...@bosatsu.net wrote:
On Mar 2, 2009, at 4:01 AM, Mark Volkmann wrote:
It's verbose in order to discourage its use since its a linear search.
See the discussion about the contains? function
On Mar 2, 1:50 pm, Frantisek Sodomka fsodo...@gmail.com wrote:
Hmm, interesting error. After the merge of the lazy branch was
everything ok, so it has to be a recent change.
user= (eval (list + 1 2 3))
java.lang.ExceptionInInitializerError (NO_SOURCE_FILE:0)
user= (eval '(+ 1 2 3))
6
Amit, Is it possible to configure a video conference for the next
clojure meeting?
On Mar 1, 12:21 pm, Amit Rathore amitrath...@gmail.com wrote:
Are any of the folks on this thread in/around the bay area? (I know
Nabib is).
We're having a clojure user-group meeting on the 12th of March - and
On 02/03/2009, at 7:23 PM, Konrad Hinsen wrote:
For namespaces other than clojure.core, an acceptable solution is to
use the :only keyword in the :use clause of the ns macro. This just
requires a bit more work in typing, but I don't see any other
potential difficulty. I am currently
Should I be able to do something like this?
(doseq [table-column (- jtable .getColumnModel .getColumns)]
javax.swing.JTable has a getColumnModel method that returns a TableColumnModel.
TableColumnModel has a getColumns method that returns EnumerationTableColumn.
I was hoping that would
I had the same issue and ended up having to use enumeration-seq function.
Seems
strange but it worked.
On Mon, Mar 2, 2009 at 4:22 PM, Mark Volkmann r.mark.volkm...@gmail.comwrote:
Should I be able to do something like this?
(doseq [table-column (- jtable .getColumnModel .getColumns)]
On Mar 2, 3:37 pm, Mark Volkmann r.mark.volkm...@gmail.com wrote:
On Mon, Mar 2, 2009 at 2:11 PM, MikeM michael.messini...@invista.com wrote:
I read the part of your article (on lists and vectors) that you linked
to in another thread -
In the list section you show the function into and
Konrad,
I'm able to do that from the REPL when done one by one :
(clojure.core/ns-unmap *ns* (quote filter))
(clojure.core/defn filter [] oh my!)
thus correctly redefining the binding of filter for the rest of use by the
ns
But I can't manage to get it work from a macro (indeed not even when
On Mar 2, 2009, at 6:37 PM, Brian Doyle wrote:
I had the same issue and ended up having to use enumeration-seq
function. Seems
strange but it worked.
The seq function is not able to provide a seq on either an Enumeration
or an Iterator.
clojure.core provides enumeration-seq and
That makes sense now. Thanks for the link to the thread.
On Mon, Mar 2, 2009 at 5:01 PM, Stephen C. Gilardi squee...@mac.com wrote:
On Mar 2, 2009, at 6:37 PM, Brian Doyle wrote:
I had the same issue and ended up having to use enumeration-seq function.
Seems
strange but it worked.
On Mon, Mar 2, 2009 at 5:42 PM, Rich Hickey richhic...@gmail.com wrote:
On Mar 2, 3:37 pm, Mark Volkmann r.mark.volkm...@gmail.com wrote:
On Mon, Mar 2, 2009 at 2:11 PM, MikeM michael.messini...@invista.com wrote:
I read the part of your article (on lists and vectors) that you linked
to
At the end of the Vectors section I say this:
All the code examples provided above for lists also work for vectors.
Do you think I should provide more detail than that?
I missed that sentence. I think it's helpful to know that some
functions return a list type when given a vector, others
There are a lot of toy cells implementations for Clojure, but as far as I
can tell none of them are really full-production ready libraries like K.
Tilton's. I'm planning on starting a GUI based project and something cell's
like would be very helpful. I may end up building it myself, and am
On Mar 2, 3:36 pm, Christophe Grand christo...@cgrand.net wrote:
You can access the latest exception through the var *e.
eg (.printStackTrace *e) will print the whole stack trace.
Worth looking is also clojure.contrib.stacktrace that tries to make Java
stack traces more readable.
Thanks,
On Mar 2, 10:41 pm, Jeffrey Straszheim straszheimjeff...@gmail.com
wrote:
First off, Clojure is not Common Lisp (to say the least), so I don't think
we necessarily need to create as stateful a library as the original Cells.
I've used Cells-like architectures before in GUI apps (although not
On 03.03.2009, at 00:53, Laurent PETIT wrote:
I'm able to do that from the REPL when done one by one :
(clojure.core/ns-unmap *ns* (quote filter))
(clojure.core/defn filter [] oh my!)
thus correctly redefining the binding of filter for the rest of use
by the ns
But I can't manage to
On 03.03.2009, at 01:01, Stephen C. Gilardi wrote:
The seq function is not able to provide a seq on either an
Enumeration or an Iterator.
clojure.core provides enumeration-seq and iterator-seq to create
seqs on them.
Yesterday I added a generic anything-to-seq multimethod to
There is meta data on var's which you need to use (meta (var sym)) to
get at, but I'm under the impression that the var metadata is mostly
for the benefit of the language runtime and a few core functions (like
doc).
The regular use of metadata I think is when you add it yourself to
symbols or
54 matches
Mail list logo