On Thu, May 5, 2011 at 10:18 AM, Trastabuga wrote:
> How do I get latest clojure and clojure-contrib?
It depends on how bleeding edge you want to be.
If you want to try the most recent monolithic contrib build, you could
depend on these:
[org.clojure/clojure "1.3.0-alpha4"]
[org.clojure.contrib
On Thu, May 5, 2011 at 4:41 PM, Alan wrote:
> Right. But if I drop all references to the returned function after I'm
> done with it, it gets GCed. If there's some class holding a reference
> to it forever, it will never get cleaned up. For example, ((fnmaker4
> (range)) 1e6) will (I think?) curren
Although (as I just realized), it fails miserably with closures.
On Thu, May 5, 2011 at 11:38 PM, Jonathan Fischer Friberg <
odysso...@gmail.com> wrote:
> I created a new datatype to solve this problem:
> http://gist.github.com/958001
> c-fn creates a comparable function;
>
> (let [fnmaker4 (fn [
I created a new datatype to solve this problem:
http://gist.github.com/958001
c-fn creates a comparable function;
(let [fnmaker4 (fn [coll] (c-fn [n] (nth coll n)))
ints (range)]
(= (fnmaker4 ints) (fnmaker4 ints)))
=> true
On Thu, May 5, 2011 at 10:41 PM, Alan wrote:
> On May 5, 1:
On May 5, 1:28 pm, Ken Wesson wrote:
> On Thu, May 5, 2011 at 4:16 PM, Alan wrote:
> > (let [fnmaker4 (fn [coll] (fn [n] (nth coll n)))
> > ints (range)]
> > (= (fnmaker4 ints) (fnmaker4 ints)))
>
> > You want to make it impossible to compare functions that close over
> > infinite sequences
On Thu, May 5, 2011 at 4:16 PM, Alan wrote:
> (let [fnmaker4 (fn [coll] (fn [n] (nth coll n)))
> ints (range)]
> (= (fnmaker4 ints) (fnmaker4 ints)))
>
> You want to make it impossible to compare functions that close over
> infinite sequences? What is the point of being able to compare
> fun
On Wed, May 4, 2011 at 8:01 PM, Ken Wesson wrote:
> Note that instantiating the class with 4 gives us an add-4-to function
> instead of the original add-3-to function here. To actually convert
> that particular closure into code that reproduces it, the array of
> constructor arguments needs to be
(let [fnmaker4 (fn [coll] (fn [n] (nth coll n)))
ints (range)]
(= (fnmaker4 ints) (fnmaker4 ints)))
You want to make it impossible to compare functions that close over
infinite sequences? What is the point of being able to compare
functions if there are cases in which using the functions w
This is another case of function-object evaluation acting hinky, actually.
Specifically, (eval (id 7)) is evaluating a list of (id 7), not ('id
7). As near as I can figure out, rather than embed the function object
reference into the code OR complain, it is creating a new instance of
its class wit
Not all of the new contrib libs have been released yet. For the ones that
have been released, you can find the .jar files here:
http://repo2.maven.org/maven2/org/clojure/
-Stuart S
clojure.com
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To pos
Hi
How do I get latest clojure and clojure-contrib? I understand now
there is no a single contrib lib, but if you go to
http://dev.clojure.org/display/design/Contrib+Projects and click on
xml project you'll an empty git project.
I tried to use clojre + contrib 1.2 but it lacks support for
javax.xm
Hi,
It is a pleasure to announce the release of Jark 0.3, today.
Why Jark?
Startup time of the Java Virtual Machine(JVM) is too slow and thereby
command-line applications on the JVM are sluggish and very painful to
use.
Jark is an attempt to run a persistent JVM daemon and provide a set of
utilit
It also seems that I have been linking to the wrong repo... :S
https://github.com/clojure/clojure
Should be the correct one.
On Thu, May 5, 2011 at 6:09 PM, Jonathan Fischer Friberg <
odysso...@gmail.com> wrote:
> I'm also interested in that.
> I think it has to do with how clojure.lang.Compiler
I'm also interested in that.
I think it has to do with how clojure.lang.Compiler [1] works (since that is
what eval uses),
but since it is quite big, I don't know exactly what parts are important.
Jonathan
[1]
https://github.com/richhickey/clojure/blob/master/src/jvm/clojure/lang/Compiler.java
O
Thanks for the pointers to the implementation, Jonathan!
Unfortunately, I couldnt' find out yet, which part of the source code
in Clojure 1.3 is responsible for fixing the misbehavior in 1.2. The
parts you point to haven't changed in 1.3.
Cheers,
Dominikus
On May 5, 4:27 pm, Jonathan Fischer Fr
Thanks a lot, Armando. Looks like I should switch to Clojure 1.3 asap.
Cheers,
Dominikus
2011/5/5 Armando Blancas :
> In 1.3 the function will (eval) to itself:
>
> Clojure 1.3.0-alpha6
> user=> (defn id [x] (list id x))
> #'user/id
> user=> (id 7)
> (# 7)
> user=> (eval (id 7))
> (# 7)
> user=>
On Thu, May 05, 2011 at 05:40:02AM -0700, Steffen wrote:
> Hello,
>
> I'm trying to come up with a way to recreate a directory hierarchy. Entries
> within zip archives are just flat strings like "top/level/file1", but I would
> like to operate on them hierarchically. So my problem could be stated
Am Donnerstag, 5. Mai 2011 16:06:52 UTC+2 schrieb odyssomay:
>
> This is my take on this: http://gist.github.com/957028
> The second file produces the correct result. The result isn't exactly like
> you asked for. This is because it wouldn't support files that isn't in the
> lowest level.
Your
Beautiful solution, I got a lot out of it.
Thanks Juha!
--
Ambrose
On Thu, May 5, 2011 at 10:08 PM, Juha Arpiainen wrote:
> (defn add-path [h path]
> (let [dir (butlast path)
>entry (last path)]
>(update-in h dir (fn [x] (if x (conj x entry) [entry])
>
> (defn restore-hierarchy
In 1.3 the function will (eval) to itself:
Clojure 1.3.0-alpha6
user=> (defn id [x] (list id x))
#'user/id
user=> (id 7)
(# 7)
user=> (eval (id 7))
(# 7)
user=> (= (id 7) (eval (id 7)))
true
On May 5, 6:04 am, Dominikus wrote:
> My observation is best distilled with the following definition of a
= uses the clojure.lang.Util/equiv to compare two "things". The source of
this function is: [1]
static public boolean equiv(Object k1, Object k2){
if(k1 == k2)
return true;
if(k1 != null)
{
if(k1 instanceof Number && k2 instanceof Num
(defn add-path [h path]
(let [dir (butlast path)
entry (last path)]
(update-in h dir (fn [x] (if x (conj x entry) [entry])
(defn restore-hierarchy [paths]
(reduce add-path {} paths))
Then
(restore-hierarchy [["top" "level" "file1"] ["top" "level" "file2"]
["top" "level2" "fil
This is my take on this: http://gist.github.com/957028
The second file produces the correct result. The result isn't exactly like
you asked for. This is because it wouldn't support files that isn't in the
lowest level.
Ex:
(restore-hierarchy [["top" "level" "file1"] ["top" "level" "file2"] ["top"
> I don't think it's flexible enough to attach this to the connection. I
> work with databases where some groups of tables really need different
> naming strategies than others so I would definitely want these
> conversions available per operation - which is how c.j.j naming
> strategies currently
> How about extending java.sql.ResultSet to implement
> clojure.lang.Seqable instead? Now that we have this capability
> wouldn't it be ideal to not have any more foo*-seq functions?
Since a ResultSet is also a resource that needs to be closed in a
timely manner it might be clearer to follow the
My observation is best distilled with the following definition of a
function in Clojure 1.2:
user=> (defn id [x] (list id x))
#'user/id
Interstingly, (id 7) and (eval (id 7)) result in different instances
of function id as the number after the '@' char unveils:
user=> (id 7)
(# 7)
user=> (eval (
Hello,
I'm trying to come up with a way to recreate a directory hierarchy. Entries
within zip archives are just flat strings like "top/level/file1", but I
would like to operate on them hierarchically. So my problem could be stated
as:
If
(restore-hierarchy [["top" "level" "file1"] ["top" "l
How about extending java.sql.ResultSet to implement
clojure.lang.Seqable instead? Now that we have this capability
wouldn't it be ideal to not have any more foo*-seq functions?
-Jeff
On May 5, 6:04 am, Sean Corfield wrote:
> I don't think it's flexible enough to attach this to the connection. I
Ty very much :)
Alfredo
On May 5, 10:05 am, Thorsten Wilms wrote:
> On 05/04/2011 06:23 PM, Alfredo wrote:
>
> >
>
> > I want to extract only the content part.
>
> I recently had related issues, so:
>
> (def metas
> (en/html-snippet
> " charset=UTF-8\" />
> "))
>
> (en/sele
On 05/04/2011 06:23 PM, Alfredo wrote:
I want to extract only the content part.
I recently had related issues, so:
(def metas
(en/html-snippet
"
"))
(en/select metas [[:meta (en/attr= :name "keywords")]])
(-> (en/select metas [[:meta (en/attr= :name "keywords")]])
first :at
30 matches
Mail list logo