On Sep 12, 2011, at 11:28 PM, Ken Wesson wrote:
But if, as you say, take, drop, etc. work for larger n, it should be
easy to make nth work with larger n and non-random-access seqs, just
by changing the non-random-access case to (first (drop n the-seq)).
I'd be rather surprised if nth suddenly
On Tue, Sep 13, 2011 at 2:39 AM, Michael Gardner gardne...@gmail.com wrote:
On Sep 12, 2011, at 11:28 PM, Ken Wesson wrote:
But if, as you say, take, drop, etc. work for larger n, it should be
easy to make nth work with larger n and non-random-access seqs, just
by changing the
Hi,
On Tuesday, September 13, 2011 6:28:01 AM UTC+2, Ken Wesson wrote:
They're trees of arrays of 32 items, and the trees can in principle
have arbitrary depth. So the 2^31 limit on Java arrays doesn't impact
the Clojure collections, it seems.
are you sure? As far as I understood things
Hi,
How can I see the error line number in SLIME? Or even somehow place editor
point on the place of the error?
For example when I load file in a lein repl, it prints:
java.lang.Exception: Unable to resolve symbol: dd in this context
(mytest.clj:447)
However when I load this file in the SLIME
On Tue, Sep 13, 2011 at 4:18 AM, Stefan Kamphausen
ska2...@googlemail.com wrote:
Hi,
On Tuesday, September 13, 2011 6:28:01 AM UTC+2, Ken Wesson wrote:
They're trees of arrays of 32 items, and the trees can in principle
have arbitrary depth. So the 2^31 limit on Java arrays doesn't impact
While reading about ClojureScript, I saw a couple of mentions of CouchDB as
a use case for ClojureScript.
Would anyone care to elaborate? Is this anything more than an abstract idea?
There is no CouchDB compile target AFAIK, and I can't see how any of the
others would work out of the box.
The
Just a little remark: Keep in mind, that clutch
https://github.com/ashafa/clutch comes with a CouchDB view server that
can execute Clojure code.
So compiling to JS only seems desirable to me, when you can't
configure an additional view server on your CouchDB.
Performance wise, it should make no
Hi Everybody,
I have a very large, but with finite size, collection. I would like to get
like first 10 elements in the sorted list . I would use a heap if I were in
c++ .. is there a inbuilt implementation of this in clojure? .. Is there
some other way to achieve this? some sort of lazy sort
There is the inbuilt sort function, also sort-by is useful.
In The joy of clojure, there were an example of a lazy sort.
It can be found here:
http://www.manning.com/fogus/
In the file q.clj in the source code.
Jonathan
On Tue, Sep 13, 2011 at 1:44 PM, Sunil S Nandihalli
I've been spending a lot of time on the continuations aspect:
http://github.com/stuartsierra/cljque
-S
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are
First, what Herwig said. :-)
Second, it's not outside of the realm of possibility that clutch might
eventually be able to take .cljs files (or clojure/cljs source inline via
clutch macro), invoke the cljs compiler, and use its existing functionality to
upload the resulting view functions' code
Just an idea at the moment. We need more people with knowledge of CouchDB to
work on it.
-Stuart Sierra
clojure.com
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new
Houston, I have a problem:
(sql/with-connection db_spec
(sql/insert-values MyTable [Number Name FloatValue]
[5, A, 2.0] [6 ,B, 3.0])
This works perfectly fine.
Now I'm trying to do the following:
(def x [[5, A, 2.0] [6 ,B, 3.0]])
(sql/with-connection db_spec
Hi,
comparing the two calls, I suppose you need apply.
(def x [[5, A, 2.0] [6 ,B, 3.0]])
(sql/with-connection db_spec
(apply sql/insert-values MyTable [Number Name FloatValue] x))
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this
What needs to be done?
Pepijn
On Sep 13, 2011, at 2:30 PM, Stuart Sierra wrote:
Just an idea at the moment. We need more people with knowledge of CouchDB to
work on it.
-Stuart Sierra
clojure.com
--
You received this message because you are subscribed to the Google
Groups Clojure
On Tue, Sep 13, 2011 at 7:44 AM, Sunil S Nandihalli
sunil.nandiha...@gmail.com wrote:
Hi Everybody,
I have a very large, but with finite size, collection. I would like to get
like first 10 elements in the sorted list . I would use a heap if I were in
c++ .. is there a inbuilt implementation
oh yes. Now it works.
Thanks for the quick response!
BTW: Does someone know how I can keep the connection always open? If I
understand it right, with-connection does a connect and login to the db
each time it gets called. Isn't this quite inefficient?
- Finn
--
You received this message
Clojure 1.3 RC0 is now available at http://clojure.org/downloads
Changes since Beta 3:
* Optimization should not demote BigInts (CLJ-836)
* Added Intrinsics
* fix nary-inline so *unchecked-math* works again
Please download it and let us know how it works for you. 1.3 is getting
close.
--
You
On Tue, Sep 13, 2011 at 6:49 AM, finbeu info_pe...@t-online.de wrote:
BTW: Does someone know how I can keep the connection always open? If I
understand it right, with-connection does a connect and login to the db
each time it gets called. Isn't this quite inefficient?
Take a look at
On Tue, Sep 13, 2011 at 1:55 AM, Sergey Didenko
sergey.dide...@gmail.com wrote:
How can I see the error line number in SLIME? Or even somehow place editor
point on the place of the error?
However when I load this file in the SLIME repl it just prints:
Unable to resolve symbol: dd in this
On Tue, Sep 13, 2011 at 6:02 AM, Christopher Redinger
redin...@gmail.com wrote:
Clojure 1.3 RC0 is now available at http://clojure.org/downloads
Changes since Beta 3:
* Optimization should not demote BigInts (CLJ-836)
* Added Intrinsics
Could someone speak to this change since it didn't have
I adore Clojure as well, but could this success not be partially due
to the reimplementing for the second time phenomenon? i.e. if you re-
wrote the entire thing in Scala again, perhaps you would see similar
gains in brevity etc?
On Sep 6, 10:32 pm, Sean Corfield seancorfi...@gmail.com wrote:
I
Isn't it Brooks who said you will throw it away at least 3 times, or
something like this ? :)
2011/9/13 Nathan Sorenson n...@sfu.ca
I adore Clojure as well, but could this success not be partially due
to the reimplementing for the second time phenomenon? i.e. if you re-
wrote the entire thing
(println (apply str (map char [72 97 112 112 121 32 80 114 111 103 114 97
109 109 101 114 32 68 97 121 33])))
---
Wilker Lúcio
http://about.me/wilkerlucio/bio
Kajabi Consultant
+55 81 82556600
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to
On Tue, Sep 13, 2011 at 12:31 PM, Wilker wilkerlu...@gmail.com wrote:
(println (apply str (map char [72 97 112 112 121 32 80 114 111 103 114 97
109 109 101 114 32 68 97 121 33])))
What kind of day is that, anyway?
(let [m map, c comp, p partial, s str]
(m (c symbol (p apply s) (p m (c char
On Sep 13, 1:44 am, Stuart Sierra the.stuart.sie...@gmail.com wrote:
Since the new, separated contrib libraries are supposed to be
compatible with Clojure 1.2, you could perhaps also start migrating
one lib at a time at your leisure. This might even enable you to
contribute to a migration
“Plan to throw one away.”
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this
On Tue, Sep 13, 2011 at 9:48 AM, Nathan Sorenson n...@sfu.ca wrote:
I adore Clojure as well, but could this success not be partially due
to the reimplementing for the second time phenomenon? i.e. if you re-
wrote the entire thing in Scala again, perhaps you would see similar
gains in brevity
Thanks, Phil !
That's it. I was using slime-load-file instead of
slime-compile-and-load-file
If you compile using C-c C-k (where it sends the filename instead of
the contents of the file) then it can determine line numbering.
--
You received this message because you are subscribed to the
There is java.util.PriorityQueue, which is heap-based:
http://download.oracle.com/javase/1,5.0/docs/api/java/util/PriorityQueue.html
-Jason
On Sep 13, 4:44 am, Sunil S Nandihalli sunil.nandiha...@gmail.com
wrote:
Hi Everybody,
I have a very large, but with finite size, collection. I would
Oh, it was just one, after all ?
Please, don't tell this to my boss :-D
2011/9/13 Meikel Brandmeyer m...@kotka.de
“Plan to throw one away.”
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
While working with ClojureScript I came across a interesting question.
When compiling cljs files, how does Clojure handle macros? Normally
macros are run at compile-time, but in this case the compile-time
platform is completely different than the run time platform. My guess
is that the compiler
For the most part, I *believe* I understand why immutable data
structures with transactions are important to manage concurrent
operations to shared data, but I often wonder why it matters in some
cases...
For example, what if I have a hash-map that needs to handle concurrent
changes to the data
Hi,
2011/9/14 Timothy Baldridge tbaldri...@gmail.com
While working with ClojureScript I came across a interesting question.
When compiling cljs files, how does Clojure handle macros? Normally
macros are run at compile-time, but in this case the compile-time
platform is completely different
To my knowledge, there are no built-in data structures that are mutable and
that use the same access functions.
There are built-in data structures called transients that are mutable, and
use almost the same hash functions. Read the docs on transient,
persistent!, conj!, etc. Transient data
For example, what if I have a hash-map that needs to handle concurrent
changes to the data structure, but never needs to have concurrent
changes to a given piece of data (i.e a key/value pair). Wouldn't
there be value in being able to modify the data in-place without
making a copy, or needing
You can reference macros defined in *clojure* files that are on your
classpath like this:
(ns my.namespace
(:require-macros [my.macros :as my])
The ClojureScript compiler will use these macros to expand your
ClojureScript source.
Works great.
David
On Tue, Sep 13, 2011 at 6:31 PM, Timothy
Thanks for the quick responses.
I'll try to answer Andy's question: How do you know, in advance, that
it doesn't need to handle such concurrent changes? ... and at the
same time I will try to provide this example to Stuart, hoping I can
see how using a map inside an atom might work:
Let's say my
I have a following API call that I need to make from Clojure:
class A
doSomething(java.lang.String arg1, String... args)
so I tried
(def a (new A)) ;this works
(.doSomething a abc efg hij)
;this doesn't work giving me no matching method found: doSomething for
class A
--
You received this
user= (class (into-array String [s a]))
[Ljava.lang.String;
Luc P.
On Tue, 13 Sep 2011 18:21:31 -0700 (PDT)
ron peterson peterson.ron...@gmail.com wrote:
I have a following API call that I need to make from Clojure:
class A
doSomething(java.lang.String arg1, String... args)
so I
Oups I did read the code entirely... you defined a varg method ?
On Tue, 13 Sep 2011 21:34:33 -0400
Luc Prefontaine lprefonta...@softaddicts.ca wrote:
user= (class (into-array String [s a]))
[Ljava.lang.String;
Luc P.
On Tue, 13 Sep 2011 18:21:31 -0700 (PDT)
ron peterson
My typos errors are horrible tonight, new laptop, new keyboard.
So if you defined a variable argument Java method the String array should work.
But I am not certain about the intent of ... in your code excerpt.
On Tue, 13 Sep 2011 21:43:03 -0400
Luc Prefontaine lprefonta...@softaddicts.ca wrote:
Hey all,
So I'm still an avid vim user. But I see a lot of power in the swank slime
setup, and have been teaching myself emacs to try to leverage it. There are
still a few tricks I haven't got. Maybe my notes are just disorganised, but
I was hoping fellow Clojurians can chime in.
- ?
Varargs are a fiction of javac, and do not exist at the bytecode
level. In real life, this method takes two args, a String and a
String[]. Use into-array to create a string array, and pass that as
the second arg.
On Sep 13, 6:21 pm, ron peterson peterson.ron...@gmail.com wrote:
I have a
On Tue, Sep 13, 2011 at 7:13 PM, Timothy Washington twash...@gmail.com wrote:
? getting an error when I i) M-x slime-connect or ii) send a form (+1 1)
to swank ; this is after i) a lein swank then ii) in another window
emacs M-x connect . ** Evaluating Slime forms seems to work after that
Have
Oh nice one mate.
Yes, I tried M-x clojure-jack-in. The main feature I'm looking for is to be
able to run a jetty / compojure stack, then connect / jack-in to that.
But now that I think about it, I can probably just pass a run jetty / ring
form to swank to start it :) Let me know if I'm on the
Thank you very much. Your suggestions worked:
(.doSomething a abc (into-array String [efg hij]))
On Sep 13, 7:33 pm, Alan Malloy a...@malloys.org wrote:
Varargs are a fiction of javac, and do not exist at the bytecode
level. In real life, this method takes two args, a String and a
String[].
I am running a swing tutorial clojure program file and when I run the
result is
++
user= (load-file c:/clojure-1.2.1/counter-app.clj)
#'user/counter-app
user=
++
What does this line mean?
#'user/counter-app
The name of my file
Sean, thx for the hint.
But how do I use the connectionpool now from clojure.java.jdbc?
(defn db-update-or-insert
Updates or inserts a fruit
[record]
(sql/with-connection db
(sql/update-or-insert-values
:fruit
[name=? (:name record)]
record)))
In my scenario, I just
On Tue, Sep 13, 2011 at 10:43 PM, finbeu info_pe...@t-online.de wrote:
But how do I use the connectionpool now from clojure.java.jdbc?
Did you read that documentation? Does it not provide enough
information? Let me know so I can make it better.
--
Sean A Corfield -- (904) 302-SEAN
An
50 matches
Mail list logo