I'm also very interested in a more public wiki for Clojure and would
help maintain it.
Seth
On Aug 17, 11:39 am, Ollie Saunders oliver.saund...@gmail.com wrote:
OK, so given all the support this idea got and the amount of material
we already have. Who should I talk to about getting access to
Hey,
I was looking computer magazines and I had the good surprise to see
clojure mentioned on the cover of Programmez, a french magazine.
The article is titled 'Cloure, a Lisp for the JVM, and seems positive
(eg, it says Clojure (...) est génial meaning Clojure is great):
I believe http://en.wikibooks.org/wiki/Clojure_Programming is the intended
central location for contributing documentation. I've heard complaints
about it's openness though.
Is it a pain to try to contribute there?
On Tue, Aug 18, 2009 at 4:52 AM, Seth seth.schroe...@gmail.com wrote:
I'm
At 09:18 AM 8/18/2009, John Newman wrote:
I believe
http://en.wikibooks.org/wiki/Clojure_Programminghttp://en.wikibooks.org/wiki/Clojure_Programming
is the intended central location for contributing documentation.
One issue with that site is its limited scope, Wikibooks
is a Wikimedia
Hi,
On Aug 18, 4:50 pm, Harold Ancell h...@ancell-ent.com wrote:
When I stumbled on the clojure-1.0.0.jar problem I updated
the appropriate page there in a few minutes including
registering an account, which isn't required:
The problem with the wikibook site is, that they
came up with some
On 2009-08-17, at 8:58 PM, FFT fft1...@gmail.com wrote:
On Mon, Aug 17, 2009 at 9:25 AM, Bradbevbrad.beveri...@gmail.com
wrote:
On Aug 17, 1:32 am, Nicolas Oury nicolas.o...@gmail.com wrote:
I was referring to the rules of the benchmark game. When you
benchmark
language, using
On Mon, Aug 17, 2009 at 11:35 PM, Mark Triggs mark.h.tri...@gmail.comwrote:
Thanks all. So combining a few suggested ideas:
(defn slice
Return the items in coll at index positions keys.
(slice [0 4 6] \abcdefg\) = (\\a \\e \\g)
[keys coll]
(let [max-idx (apply max keys)
The most straight-forward answer I would have given is also:
(defn slice [indices coll]
(map #(nth coll %) indices))
Is there some disadvantage with this approach that I'm not seeing?
-Patrick
--~--~-~--~~~---~--~~
You received this message because you are
At 10:20 AM 8/18/2009, Meikel Brandmeyer wrote:
Hi,
Greetings and salutations.
On Aug 18, 4:50 pm, Harold Ancell h...@ancell-ent.com wrote:
When I stumbled on the clojure-1.0.0.jar problem I updated
the appropriate page there in a few minutes including
registering an account, which isn't
If coll has O(n) access and we impose the restriction that indices is
increasing (or sort it up front), we can do better than this by only
doing one pass through coll.
On Aug 18, 10:46 am, CuppoJava patrickli_2...@hotmail.com wrote:
The most straight-forward answer I would have given is also:
On Aug 17, 3:51 am, Christophe Grand christo...@cgrand.net wrote:
On Sat, Aug 15, 2009 at 4:23 PM, Andy Fingerhut
andy_finger...@alum.wustl.edu wrote:
Not to say this ought to be done, but would it be possible to have no
'edit' field *at all* for persistent data structures (not even a
On Mon, Aug 17, 2009 at 9:25 AM, Bradbevbrad.beveri...@gmail.com wrote:
On Aug 17, 1:32 am, Nicolas Oury nicolas.o...@gmail.com wrote:
I was referring to the rules of the benchmark game. When you benchmark
language, using another language is not fair.
If you were to do your own program, of
I believe your result set is closed by the time you execute your
statement. If you use (class (sel)) you will notice it is a resultset.
Start by executed your desired s-exp inside the macro at the REPL.
Then I would
use a let/map combination to turn it into a fn.
Hope this helps,
Sean
On Aug
I am trying to use the JDBC-ODBC with the following code:
(use '[clojure.contrib.sql])
(def db {:classname sun.jdbc.odbc.JdbcOdbcDriver
:subprotocol odbc
:subname jdbc:odbc:D2D1
:username ERASUSR
:password REPORTS})
(defn sel []
(with-connection db
entering (with-connection db) on the repl yields the same error,
making me think it's still something wrong with how I am going about
connection to the dsn.
On Aug 18, 3:07 pm, Sean Devlin francoisdev...@gmail.com wrote:
I believe your result set is closed by the time you execute your
On Tue, Aug 18, 2009 at 11:28 AM, Brad
Beveridgebrad.beveri...@gmail.com wrote:
On 2009-08-17, at 8:58 PM, FFT fft1...@gmail.com wrote:
On Mon, Aug 17, 2009 at 9:25 AM, Bradbevbrad.beveri...@gmail.com
wrote:
Ah, that makes more sense re the cheating then. Your insight for
array range
2009/8/18 shane semmon...@gmail.com:
I am trying to use the JDBC-ODBC with the following code:
(use '[clojure.contrib.sql])
(def db {:classname sun.jdbc.odbc.JdbcOdbcDriver
:subprotocol odbc
:subname jdbc:odbc:D2D1
[...]
I use this dsn (D2P1) in a number of other
Clojure's binding form only establishes vars with dynamic extent
limited to the current thread. This makes a lot of sense. However, I
have a use case where I'd like it to establish the dynamic extent in a
way which affects the current thread and all threads started within
the current thread.
On Tue, Aug 18, 2009 at 3:32 PM, Aaron Cohenremled...@gmail.com wrote:
On Tue, Aug 18, 2009 at 11:28 AM, Brad
Beveridgebrad.beveri...@gmail.com wrote:
On 2009-08-17, at 8:58 PM, FFT fft1...@gmail.com wrote:
On Mon, Aug 17, 2009 at 9:25 AM, Bradbevbrad.beveri...@gmail.com
wrote:
Ah, that
Yep, this was my thinking too. Maybe it doesn't matter, but I'm always
a little reluctant to make those sort of compromises when writing
general-purpose utility functions.
Mark
Andrew Baine andrew.ba...@gmail.com writes:
If coll has O(n) access and we impose the restriction that indices is
Hi,
Am 18.08.2009 um 20:28 schrieb shane:
(defn sel []
(with-connection db
(with-query-results rs [SELECT * FROM
DB2PROD.ED0CDT_CYCLE_DATES]
(map :CYCLE_IND rs
Michael's suggestion about the typo is plausible.
Should that fix the connection problem, you will
almost surely want
http://www.youtube.com/watch?v=xquJvmHF3S8
Dan Weinreb gave a great talk at Google entitled Lisp for
High-Performance Transaction Processing on Monday, where he talks
about the use of Common Lisp at ITA Software. The last 10 - 15 minutes
of the talk he discusses the future of Lisp: Common Lisp,
Hi,
Am 18.08.2009 um 21:40 schrieb Constantine Vetoshev:
(binding* [*x* 3]
(start-jetty :port 8001 :my-servlet servlet-implemented-in-clojure))
There are two Assembla tickets, which go into that direction:
http://www.assembla.com/spaces/clojure/tickets/169-thread-local-bindings-interface
Daniel Weinreb (of Common Lisp fame) talks about Clojure in the second
part of this Google Tech Talk:
http://www.youtube.com/watch?v=xquJvmHF3S8
Rock
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Clojure group.
Ah... and the function that I called split should really be called
slice.
And lazy_reduce should really be called lazy-reduce i keep on
forgetting to use hypens instead of underscores.
-Patrick
--~--~-~--~~~---~--~~
You received this message because you are
repeatedly is the function that you're looking for in the first
question.
And = should work I think:
(= [1 2 3] [1 2 3]) returns true.
Hope that helps
-Patrick
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups
I see. Thanks for explaining.
If speed is an issue, and if you can assume that indices are properly
sorted in ascending order, I believe this looks like a lazy-reduce
problem. Clojure has no lazy-reduce (or does it?) so I've written my
own:
(defn lazy_reduce [f val coll]
(lazy-seq
(if
Hi, I was wondering if there's a more idiomatic way to do the
following:
(defn flip-coin []
(int (rand 2)))
(let [coin-flips (for [x (repeat true)] (flip-coin))]
Basically I want to generate an infinite lazy sequence based on the
output of a given function with zero or more arguments.
On Aug 19, 1:08 am, tmountain tinymount...@gmail.com wrote:
Hi, I was wondering if there's a more idiomatic way to do the
following:
(defn flip-coin []
(int (rand 2)))
To add to CuppoJava's advice, (rand-int 2) is a synonym of (int (rand
2)).
All the best,
Tayssir
Status: I've applied for membership on the dev list, citing this
thread so this can be discussed with the major contributors.
2009/8/18 Harold Ancell h...@ancell-ent.com:
At 10:20 AM 8/18/2009, Meikel Brandmeyer wrote:
Hi,
Greetings and salutations.
On Aug 18, 4:50 pm, Harold Ancell
That works nicely, even for infinite sequences, but appears to hang on
to the head:
user= (split [2000 2001] (repeatedly #(int-array 102400)))
java.lang.OutOfMemoryError: Java heap space
The map/nth variant has this same problem, unfortunately. My original
version works around these issues
And = should work I think:
(= [1 2 3] [1 2 3]) returns true.
Oh man... now I feel stupid. Thanks for the help!
Travis
On Aug 18, 7:17 pm, CuppoJava patrickli_2...@hotmail.com wrote:
repeatedly is the function that you're looking for in the first
question.
And = should work I think:
(=
Hello Clojurians,
I commonly use a set in my filtering operations, like the example
below.
user= (filter #{\a \e \i \o \u} The quick brown fox jumped over the
lazy dog)
(\e \u \i \o \o \u \e \o \e \e \a \o)
Today I found myself using the following code
user= (filter #{false} [true false false
What if someone wanted to slice a multi-dimensional vector (vector of
vectors of vectors ...) or even just an ordinary matrix (vector of
vectors).
Is there a way to extend this beyond an ordinary one-dimensional
vector?
Rock
On Aug 18, 3:17 am, Mark Triggs mark.h.tri...@gmail.com wrote:
Hi
On Tue, Aug 18, 2009 at 7:37 PM, Sean Devlin francoisdev...@gmail.comwrote:
user= (filter #{false} [true false false true])
()
Obviously, this is not what I intended. The best I could do was the
following
user= (filter (comp not nil? #{false}) [true false false true])
(false false)
The set is being passed in as a parameter, so that will be a problem.
Still, I'll be able to re-write my routine with false. Thanks!
On Aug 18, 8:18 pm, J. McConnell jdo...@gmail.com wrote:
On Tue, Aug 18, 2009 at 7:37 PM, Sean Devlin francoisdev...@gmail.comwrote:
user= (filter #{false}
Hmm... I suppose so. That would depend on the semantics that you want.
How exactly would a multi-dimensional slice work?
Right now, if you use slice on a multi-dimensional vector, it will
return a list of vectors for you, which you can further slice to your
heart's content. Perhaps that's good
Sigh... I never did understand that head hanging part. I need to go
back and read Rich's post in more detail.
Does anyone know if there's a compounded collection of all of Rich's
webpages which aren't officially online yet? eg. clojure.org/lazy,
clojure.org/streams, etc...
-Patrick
Hi,
The problem here is that filter is expecting a predicate and you are
passing a set.
When used as a function like so
user= (#{1 2 3} 2)
2
user= (#{1 2 3} 5)
nil
the set returns the argument if it is in the set and nil otherwise.
The problem you are observing is because the
Why doesn't this work?
Clojure 1.0.0-
user= (declare aaa)
#'user/aaa
user= (var (symbol aaa))
java.lang.ClassCastException: clojure.lang.PersistentList cannot be
cast to clojure.lang.Symbol (NO_SOURCE_FILE:2)
user= (var 'aaa)
java.lang.ClassCastException: clojure.lang.Cons cannot be cast to
Hi Sean,
I think your solution with (comp not nil? ... ) is very clean already.
But in case you don't like that, here's another way of writing it:
(filter #(contains? #{false} %) [false true false true])
returns (false false)
It probably gets compiled to almost the same thing under the hood.
user= (resolve (symbol aaa))
#'user/aaa
might be what you want?
On Aug 19, 1:11 pm, samppi rbysam...@gmail.com wrote:
Why doesn't this work?
Clojure 1.0.0-
user= (declare aaa)
#'user/aaa
user= (var (symbol aaa))
java.lang.ClassCastException: clojure.lang.PersistentList cannot be
cast
42 matches
Mail list logo