Re: Bumi, a project for loading a git repo into a Titan graph database

2013-02-27 Thread Rich Morin
On Feb 21, 2013, at 09:34, Zack Maril wrote: > codeq looks fantastic and I've looked into using it before. The project > seems to > have undergone a flurry of activity last October/November and then nothing has > really happened with it since then. Work continues, but getting from Rich Hickey's

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Marko Topolnik
On Wednesday, February 27, 2013 12:53:14 AM UTC+1, Luc wrote: > > Why insist on getting Clojure to be at par with languages that may offer a > performance > boost on narrow problems at the expense of making parallel processing and > code > in general more complex everywhere else ? > This doe

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Marko Topolnik
On Wednesday, February 27, 2013 5:19:20 AM UTC+1, Isaac Gouy wrote: > > If idiomatic Clojure was used... >> > > The problem, of course, is that: the code one-person considers to be > idiomatic; another person considers to be idiotic, naïve. > Not really. Take Stuart Halloway's opening example i

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Marko Topolnik
> (defn blank? [s] (every? #(Character/isWhitespace %) s)) > > Have you ever wondered about its performance? Here you go: > > user> (time (dotimes [_ 1] (blank? " > "))) > "Elapsed time: 3887.578 msecs" > To give a more complete picture, this vers

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Christophe Grand
On Wed, Feb 27, 2013 at 10:21 AM, Marko Topolnik wrote: > > (defn blank? [s] (every? #(Character/isWhitespace %) s)) >> >> Have you ever wondered about its performance? Here you go: >> >> user> (time (dotimes [_ 1] (blank? " >> "))) >> "Elapsed time: 3887.578 msecs" >> > > To give

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Marko Topolnik
On Wednesday, February 27, 2013 10:59:33 AM UTC+1, Christophe Grand wrote: > > Now that reduce can be short-circuited, redifining every?, some and al on > top of it would yield some interesting gains: > > (defn revery? [pred coll] > (reduce (fn [t x] > (if (pred x) > t

New Dutch Clojure group - Rotterdam/Den Haag Clojure Meetup - EHRD.clj

2013-02-27 Thread Vijay Kiran
Hi All, On Wednesday 27th March we will be hosting the inaugural EHRD.clj in Rotterdam. The first meeting will feature a talk from Christophe Grand (Clojure core contributor and co-author of Clojure Programming) plus beer and nibbles. We will be meeting from 7p

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Meikel Brandmeyer (kotarak)
Hi, the recur is not for optimisation but for short-circuiting so that every? kind of works like and. Stoppable reduce allows now to exploit the internal reduce for strings while still keeping the short-circuiting of every?. Kind regards Meikel -- -- You received this message because you are

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Christophe Grand
On Wed, Feb 27, 2013 at 11:20 AM, Marko Topolnik wrote: > On Wednesday, February 27, 2013 10:59:33 AM UTC+1, Christophe Grand wrote: > >> >> Now that reduce can be short-circuited, redifining every?, some and al on >> top of it would yield some interesting gains: >> >> (defn revery? [pred coll] >>

Why not when-let* ?

2013-02-27 Thread Vladimir Tsichevski
Hi, The when-let macro is great, but it accepts only one binding. Why? Are there any reason why this macro was not ever extended to support multiple bindings (defined, for example, here: http://inclojurewetrust.blogspot.ru/2010/12/when-let-maybe.html)? (when-let* [x (something)

wouldn't it make sense for identity to take variadic args?

2013-02-27 Thread Jim foo.bar
I often find myself asking for identity of something but identity takes a single argument! Why not have it take as many as one likes but only return the identity of the first? I find that very handy...do people agree? (defn identity "Returns its argument or its first argument when there are mor

Re: wouldn't it make sense for identity to take variadic args?

2013-02-27 Thread Chris Ford
Can you give an example use case? Personally, I would be a little surprised to find out that identity worked like this. After all, why return the first argument, why not the last? Or a vector of all the arguments? Cheers, Chris On 27 February 2013 15:02, Jim foo.bar wrote: > I often find myse

Re: wouldn't it make sense for identity to take variadic args?

2013-02-27 Thread Jim foo.bar
On 27/02/13 12:12, Chris Ford wrote: Can you give an example use case? sure... sometimes I do something this: (map (if even? (fn [num _] (identity spans)) str) some-seq1 some-seq2) but I'd like to write this instead: (map (if even? identity str) some-seq1 some-seq2) Personally, I would be

Re: wouldn't it make sense for identity to take variadic args?

2013-02-27 Thread Jim foo.bar
thinking about it a bit more, it would certainly make sense to return a seq with all the identities. Then I can just ask for the first...hmm interesting :) Jim On 27/02/13 12:20, Jim foo.bar wrote: On 27/02/13 12:12, Chris Ford wrote: Can you give an example use case? sure... sometimes I

Re: wouldn't it make sense for identity to take variadic args?

2013-02-27 Thread Marko Topolnik
Apparently you misunderstand the term *identity*. The sense is the same as in *identity transform*: it is a function that transforms its argument into itself. It is useful in the context of higher-order functions where it plays the role of a no-op. None of your uses of *identity* make sense to m

Re: wouldn't it make sense for identity to take variadic args?

2013-02-27 Thread Jim foo.bar
On 27/02/13 12:35, Marko Topolnik wrote: it is a function that transforms its argument into itself. It is useful in the context of higher-order functions where it plays the role of a no-op that is exactly what I'm trying to do..a no-op based on some condition...Though, I can see why it would

Re: Why not when-let* ?

2013-02-27 Thread juan.facorro
In the short time I've been active in the list, I've seen this topic come up a couple of times, and they both have come up really close to each other also, there's been one in December and

Re: wouldn't it make sense for identity to take variadic args?

2013-02-27 Thread Marko Topolnik
In this line: (map (if even? (fn [num _] (identity spans)) str) some-seq1 some-seq2) you appear to involve *identity* in a way that makes no sense since (identity spans) is just spans. You also don't involve the *num* argument at all; but maybe you meant (map (if even? (fn [num _] num) str)

Re: wouldn't it make sense for identity to take variadic args?

2013-02-27 Thread Jim foo.bar
On 27/02/13 12:52, Marko Topolnik wrote: In this line: (map (if even? (fn [num _] (identity spans)) str) some-seq1 some-seq2) you appear to involve /identity/ in a way that makes no sense since (identity spans) is just spans. You also don't involve the /num/ argument at all; but maybe you me

Re: wouldn't it make sense for identity to take variadic args?

2013-02-27 Thread Marko Topolnik
On Wednesday, February 27, 2013 2:02:36 PM UTC+1, Jim foo.bar wrote: > > The actual code looks like this: > > (let [tok-array (into-array ^String token-seq)] > (map > #((if spans? (fn [span _] span) spans->strings) ;;decide what fn to use > (.find this tok-array) tok-array) > token-seq) > >

Re: wouldn't it make sense for identity to take variadic args?

2013-02-27 Thread Jim foo.bar
On 27/02/13 13:10, Marko Topolnik wrote: A side note: since /spans?/ is a constant within the /map/ transform, it would pay to decide up-front which function to use: nice catch! Jim ps: thanks a lot for your comments :) -- -- You received this message because you are subscribed to the Google

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Softaddicts
Well then lets stop trying to twist the code further. Commenting that Clojure "looses" in these benchmarks or is pushed in the same backyard than ruby is counter productive. What I have seen so far is pulling toward extreme contorsions to achieve better performance at the expense of code readabi

ANN Langohr 1.0.0-beta12 is released

2013-02-27 Thread Michael Klishin
Langohr [1] is a Clojure RabbitMQ client that embraces the AMQP 0.9.1 Model [2]. Release notes for beta12: http://blog.clojurewerkz.org/blog/2013/02/27/langohr-1-dot-0-0-beta12-is-released/ 1. http://clojurerabbitmq.info 2. http://www.rabbitmq.com/tutorials/amqp-concepts.html -- MK http://githu

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Marko Topolnik
In your specific case, where you want every last inch of performance, it is acceptable that you will need to use the optimized idiom. However, if your overall code did anything else besides banging hard against your algorithm, a performance say 5 times worse than Java may soon become acceptable.

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Marko Topolnik
On Wednesday, February 27, 2013 12:48:13 AM UTC+1, David Nolen wrote: > > Hang out with JRuby? Seriously? > > http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?test=all&lang=clojure&lang2=jruby > Well, all the code-size bars are above the baseline :) Let's see how it fares when they dis

problem redefining protocols and records in emacs+nrepl

2013-02-27 Thread Joachim De Beule
Hi all, I'm doing interactive development with emacs+clojure-mode+nrepl and I'm experiencing some seriously annoying problems with protocols and records implementing the protocols: 1) When I redefine a protocol by adding a method to it, and then re-implement a record according in accordance to th

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Softaddicts
I disagree with your last statement. If you look backward, you will find that most languages were created with one or two strong influential ideas at the start. Many of them died of not being extendable to meet new concepts (Snobol, Algol, Simula, APL, ...) It did not prevent many of them to be

Re: problem redefining protocols and records in emacs+nrepl

2013-02-27 Thread Jim - FooBar();
I'm not sure I fully understand the problem but I'll do my best to guess... 1) are you sure you're using the protocol or are you actually trying to define a method in the interface that the protocol generates? Try fully qualifying the name of you protocol at the extension point... 2)Do your p

Clojure crash on OpenJDK 8

2013-02-27 Thread Ben Evans
Hi, lein repl is crashing on OpenJDK 8 consistently for me, with this error: Exception in thread "main" java.lang.ClassCastException: clojure.tools.nrepl.server.Server cannot be cast to compile__stub.clojure.tools.nrepl.server.Server at clojure.tools.nrepl.server.Server.valAt(server.clj:1

Re: Clojure crash on OpenJDK 8

2013-02-27 Thread AtKaaZ
the stacktrace points here: https://github.com/clojure/tools.nrepl/blob/master/src/main/clojure/clojure/tools/nrepl/server.clj#L100 but that's all I got:) On Wed, Feb 27, 2013 at 5:47 PM, Ben Evans wrote: > Hi, > > lein repl is crashing on OpenJDK 8 consistently for me, with this error: > > Exce

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Isaac Gouy
On Wednesday, February 27, 2013 1:13:10 AM UTC-8, Marko Topolnik wrote: > > On Wednesday, February 27, 2013 5:19:20 AM UTC+1, Isaac Gouy wrote: > >> >> If idiomatic Clojure was used... >>> >> >> The problem, of course, is that: the code one-person considers to be >> idiomatic; another person con

instance? with one argument

2013-02-27 Thread Phillip Lord
The instance? function does not crash with a single argument, when I think that it should throw an arity exception. I asked on SO about this a while back, so I now know why, but I got hit by this again yesterday. I think this is a bug, but I am not sure whether I have missed a good reason why i

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Marko Topolnik
On Wednesday, February 27, 2013 5:17:16 PM UTC+1, Luc wrote: > > There's no magic. You cannot win on all fronts. > You defeatist, you :) I'm just trying to represent the enthusiastic perspective where "if it *could* be better, it *must* be better". In many respects Clojure already embodies exa

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Marko Topolnik
On Wednesday, February 27, 2013 5:59:25 PM UTC+1, Isaac Gouy wrote: > > (defn blank? [s] (every? #(Character/isWhitespace %) s)) >> >> Have you ever wondered about its performance? >> > > No. Why would I wonder about the performance of a one line code snippet > that was written without concern

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Timothy Baldridge
Luc makes a good point. And that's one thing that I love about Clojure. It is possible to have (more or less) the same language on different platforms with different trade-offs, with little effort. Just look at the three examples we have now: Clojure - Pretty awesome performance + interop with all

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Timothy Baldridge
And by "with little effort" I mean "with little effort compared to porting other languages to different platforms". Given 8 hour work days a single man can hack out Clojure on almost any platform in a few months. That's quite impressive considering how hard it would be to do the same for Ruby/Pyth

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Andy Fingerhut
On Feb 27, 2013, at 9:07 AM, Marko Topolnik wrote: > > > On Wednesday, February 27, 2013 5:59:25 PM UTC+1, Isaac Gouy wrote: > (defn blank? [s] (every? #(Character/isWhitespace %) s)) > > Have you ever wondered about its performance? > > No. Why would I wonder about the performance of a one

Re: Clojure crash on OpenJDK 8

2013-02-27 Thread Kevin Downey
what version of clojure are you using? I doubt line #100 of main is the correct line in server.clj, the content of the stacktrace looks more like https://github.com/clojure/tools.nrepl/blob/master/src/main/clojure/clojure/tools/nrepl/server.clj#L146, what version of nrepl? https://github.com/cloju

How to import classes from a runtime-defined ClassLoader?

2013-02-27 Thread dgrnbrg
I am trying to include some Groovy code at runtime, which is already on the JVM's classloader path. I have succeeded in setting the groovy.lang.GroovyClassLoader with Clojure's classloader as the Thread's contextClassLoader, but I'm having troubling getting (import ...) to work. I discovered so

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Marko Topolnik
On Wednesday, February 27, 2013 6:28:03 PM UTC+1, Andy Fingerhut wrote: If you wanted to create a collection of idiomatic Clojure programs for > solving a particular set of problems, e.g. the Benchmarks Game problems, as > soon as more than one person submitted a program and/or reviewed a progra

Re: Why not when-let* ?

2013-02-27 Thread Ben Wolfson
On Wed, Feb 27, 2013 at 4:40 AM, juan.facorro wrote: > In the short time I've been active in the list, I've seen this topic come up > a couple of times, and they both have come up really close to each other > also, there's been one in December and another in January :P > > What I understand from t

(def newsletter)

2013-02-27 Thread Rich Morin
I just ran across this and don't see anything about it in my list archives, so... (def newsletter) A weekly Clojure newsletter http://defnewsletter.com Seems like a useful way to keep up with announcements, etc. -r -- http://www.cfcl.com/rdmRich Morin http://www.cfcl.com/rdm

Improving visibility of clojure-doc.org

2013-02-27 Thread Michael Klishin
Started in October 2012, http://clojure-doc.org is a pretty extensive community documentation effort. It covers Clojure, its ecosystem and tools and has two key goals: * We produce beginner-friendly content * It is dead easy to join and help Even though recently that hasn't been as much activit

Re: Improving visibility of clojure-doc.org

2013-02-27 Thread Josh Kamau
How about introducing a section with solutions to this ( http://projecteuler.net/problems) or other problems. While most of us beginners can write clojure code, solving problems in an idiomatic way is another story. You could have a page for each question and users can each attempt and learn from

Re: [clj-power] Improving visibility of clojure-doc.org

2013-02-27 Thread Sean Corfield
FWIW, I've added a permanent link to clojure-doc.org from my blog with the link text Clojure Documentation - perhaps others who have blogs could do the same? I was looking at meetup.com to see if I could easily find a way to add resources / links to a group's home page, thinking it would be a good

Re: Clojure crash on OpenJDK 8

2013-02-27 Thread Herwig Hochleitner
FWIW, I've just built jdk8-b78 on my linux machine (due to the oracle build being unavailable) and everything seemed to work: % JAVA_CMD=~/checkout/openjdk8/build/linux-x86_64-normal-server-release/images/j2re-image/bin/java lein version Leiningen 2.0.0 on Java 1.8.0-internal OpenJDK 64-Bit Server

Re: instance? with one argument

2013-02-27 Thread Herwig Hochleitner
This special handling technique is known as a compiler macro in clojurescript (and elsewhere). Essentially, all direct calls to instance? get emitted as an instanceof expression for performance. Higher order uses behave as expected: user=> (apply instance? Long []) ArityException Wrong number of a

Re: instance? with one argument

2013-02-27 Thread Herwig Hochleitner
Also direct calls are only handled, if the first arg is a symbol that directly resolves to a class: user=> (def C Long) user=> (instance? C) ArityException Wrong number of args (1) passed to: core$instance-QMARK- clojure.lang.AFn.throwArity (AFn.java:437) Starting from this, I just discovered an

Re: Clojure crash on OpenJDK 8

2013-02-27 Thread Ben Evans
On Wed, Feb 27, 2013 at 5:42 PM, Kevin Downey wrote: > what version of clojure are you using? I doubt line #100 of main is the > correct line in server.clj, the content of the stacktrace looks more like > https://github.com/clojure/tools.nrepl/blob/master/src/main/clojure/clojure/tools/nrepl/serve

Re: Clojure crash on OpenJDK 8

2013-02-27 Thread Kevin Downey
clojure uses a class called DynamicClassloader to load runtime generated classes, but it is a pretty strait forward extension of URLClassloader On Wed, Feb 27, 2013 at 11:27 AM, Ben Evans wrote: > On Wed, Feb 27, 2013 at 5:42 PM, Kevin Downey wrote: > > what version of clojure are you using? I

Re: [clj-power] Improving visibility of clojure-doc.org

2013-02-27 Thread Alex Miller
I've updated http://clojure.org/documentation to add a link to http://clojure-doc.org. I think it's a great resource for all Clojure developers!! I think it would be useful in your regular updates to highlight areas that could use help. Another area that I think would be useful in addition to the

Re: Clojure crash on OpenJDK 8

2013-02-27 Thread Herwig Hochleitner
2013/2/27 Ben Evans > To add a bit more light on this, my JDK 8 Mac build is from the lambda > repo, so may have changes which are ahead of mainline JDK8 (to > Herwig's point). > Tried lambda-8-b79-linux-x64-25_feb_2013.tar.gz from http://jdk8.java.net/lambda/ it works for me aswell. I gotta run

core.logic: Dividing the knowledge base

2013-02-27 Thread JvJ
I'm creating something with core.logic that involves multiple "agents"(not the same as a clojure agent!) which each have distinct knowledge. I'd like to know the best way of going about separating the knowledge base so that it can be accessed by each agent individually. The simplest thing I c

Re: core.logic: Dividing the knowledge base

2013-02-27 Thread David Nolen
Sounds like an interesting idea though I can't give much guidance about how to approach it. Curious to know how it goes though! On Wed, Feb 27, 2013 at 3:50 PM, JvJ wrote: > > I'm creating something with core.logic that involves multiple "agents"(not > the same as a clojure agent!) which each h

Re: core.logic: Dividing the knowledge base

2013-02-27 Thread JvJ
Thanks for the quick reply. I guess I'll go through with my initial plan and see what happens. Thanks. On Wednesday, 27 February 2013 16:14:49 UTC-5, David Nolen wrote: > > Sounds like an interesting idea though I can't give much guidance about > how to approach it. Curious to know how it goes

Re: core.logic: Dividing the knowledge base

2013-02-27 Thread JvJ
Actually, I have a quick question. How could I modify the following code to add some metadata to he newly defined relation? (defmacro defkrel "Macro for defining knowledge-based relations." [nme & rest] `(defrel ~nme ~'agent ~@rest)) On Wednesday, 27 February 2013 16:17:30 UTC

Re: core.logic: Dividing the knowledge base

2013-02-27 Thread David Nolen
Hrm, how are you going to consume that metadata? On Wed, Feb 27, 2013 at 4:26 PM, JvJ wrote: > Actually, I have a quick question. How could I modify the following code > to add some metadata to he newly defined relation? > > (defmacro defkrel > "Macro for defining knowledge-based relations."

defmacro/gen-class/annotation woes

2013-02-27 Thread Michael Willis
Hi Folks, I'm attempting to write a clojure macro that uses gen-class to replace several manually written Java classes that all follow a similar pattern. Yes, in my magic world of unicorns and mermaids, I would just rewrite them in pure clojure, but for the context of this question my solution

Re: [clj-power] Improving visibility of clojure-doc.org

2013-02-27 Thread Daniel Glauser
I added a link to http://clojure-doc.org in both the group discussion and the about page for the Den of Clojure (http://www.meetup.com/denofclojure/). Sean (or anyone else for that matter) is there an easy way we can let the rest of the user group to lend a hand? Is there a better place to post

Re: core.logic: Dividing the knowledge base

2013-02-27 Thread JvJ
Actually, I figured it out. I just didn't realize you had to do the #' thing to get the meta from a function. But! I'm basically going to write a variation of run* that binds an agent to the first argument of any "knowledge-based" relations. So, if they have something like {:knowledge true}

Re: core.logic: Dividing the knowledge base

2013-02-27 Thread Norman Richards
On Wed, Feb 27, 2013 at 2:50 PM, JvJ wrote: > > I'm creating something with core.logic that involves multiple "agents"(not > the same as a clojure agent!) which each have distinct knowledge. I'd like > to know the best way of going about separating the knowledge base so that > it can be accessed

Re: core.logic: Dividing the knowledge base

2013-02-27 Thread David Nolen
I'm also enthusiastic about eventually replacing the current core.logic defrel/fact stuff with this excellent work. David On Wed, Feb 27, 2013 at 4:45 PM, Norman Richards wrote: > > > On Wed, Feb 27, 2013 at 2:50 PM, JvJ wrote: > >> >> I'm creating something with core.logic that involves multi

Re: core.logic: Dividing the knowledge base

2013-02-27 Thread JvJ
Wow. Thanks, this will probably help a lot! On Wednesday, 27 February 2013 16:45:07 UTC-5, Norman Richards wrote: > > > > On Wed, Feb 27, 2013 at 2:50 PM, JvJ >wrote: > >> >> I'm creating something with core.logic that involves multiple >> "agents"(not the same as a clojure agent!) which each ha

Re: core.logic: Dividing the knowledge base

2013-02-27 Thread JvJ
It states that retractions aren't yet implemented. Is there any way to delete facts? On Wednesday, 27 February 2013 16:45:07 UTC-5, Norman Richards wrote: > > > > On Wed, Feb 27, 2013 at 2:50 PM, JvJ >wrote: > >> >> I'm creating something with core.logic that involves multiple >> "agents"(not t

Re: core.logic: Dividing the knowledge base

2013-02-27 Thread Norman Richards
On Wed, Feb 27, 2013 at 4:03 PM, JvJ wrote: > It states that retractions aren't yet implemented. Is there any way to > delete facts? This is something I want to add, and if it's something you could use now, I'll bump up priority of getting that in. What we do is just build a new logic db for

Re: core.logic: Dividing the knowledge base

2013-02-27 Thread JvJ
If it's not too much trouble, it's something I'd like to see, but I'm sure I can find a way around it somehow. On Wednesday, 27 February 2013 17:08:24 UTC-5, Norman Richards wrote: > > > > On Wed, Feb 27, 2013 at 4:03 PM, JvJ >wrote: > >> It states that retractions aren't yet implemented. Is the

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Isaac Gouy
On Wednesday, February 27, 2013 9:48:15 AM UTC-8, Marko Topolnik wrote: > However, if someone comes along with *(let [m (HashMap.)] (loop > []...(recur (.put m ...)))* claiming that is in fact idomatic, he's just > being unreasonable---by everyone's agreement. > You don't think there are fas

Re: core.logic: Dividing the knowledge base

2013-02-27 Thread JvJ
One more thing I'd like to ask. Is it possible to combine the databases in a way? For instance, I'd like to have a universal database that every agent can access, as well as agent-specific databases. I understand that databases can be modified in a purely functional way (which is great), but

[ANN] clj-nio2 0.1.0

2013-02-27 Thread Jürgen Hötzel
Hi, I implemented some high-level wrappers for the File(system) improvements introducedin NIO.2/Java 7. In particular: - Handle filesystem events (WatchService) via a lazy *watch-se*q - Read directories using a lazy *dir-seq* - Implementation of * clojure.java.io/Coercions * and *

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Ben Mabey
On 2/27/13 9:59 AM, Isaac Gouy wrote: On Wednesday, February 27, 2013 1:13:10 AM UTC-8, Marko Topolnik wrote: On Wednesday, February 27, 2013 5:19:20 AM UTC+1, Isaac Gouy wrote: If idiomatic Clojure was used... The problem, of course, is that: the code one-person co

Re: problem redefining protocols and records in emacs+nrepl

2013-02-27 Thread Joachim De Beule
Hi Jim, I'm sorry I can't really be more specific. I tried to duplicate the problems with a few simple steps, but they only seem to turn when things get complicates, e.g. involve different namespaces etc. I now even encountered a third problem which I think is related to the other two because

Re: problem redefining protocols and records in emacs+nrepl

2013-02-27 Thread Joachim De Beule
(At the end of my previous update, I mean namespaces 1, 2 and 3 instead of A, B and C. Sorry for that ...) Op woensdag 27 februari 2013 23:49:42 UTC+1 schreef Joachim De Beule het volgende: > > Hi Jim, > > I'm sorry I can't really be more specific. I tried to duplicate the > problems with a few

Re: problem redefining protocols and records in emacs+nrepl

2013-02-27 Thread Joachim De Beule
Oops, sorry again, this last problem was just a stupid mistake, pls ignore it (I guess I'm not just getting annoyed but also a bit too suspicious) Op woensdag 27 februari 2013 23:53:46 UTC+1 schreef Joachim De Beule het volgende: > > (At the end of my previous update, I mean namespaces 1, 2 and

AOT and side-effects associated to ns initialization

2013-02-27 Thread vemv
So I was playing with AOT for the first time. My main reason to use it is so the consumer Java code doesn't look so alien / run-timey. The thing is, I encountered that the following line causes `lein compile` to hang: (defn -server [] (jetty/run-jetty #'app {:port 8000 :join? false})) (fo

AOT and side-effects associated to ns initialization

2013-02-27 Thread vemv
So I was playing with AOT for the first time. My main reason to use it is so the consumer Java code doesn't look so alien / run-timey. The thing is, I encountered that the following line causes `lein compile` to hang: (def server (jetty/run-jetty #'app {:port 8000 :join? false})) (for tho

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Jon Seltzer
I beg to differ. You can't separate an assessment of idiomaticity from the specific problem domain. *That* is true no matter what the language. On Feb 27, 9:48 am, Marko Topolnik wrote: > On Wednesday, February 27, 2013 6:28:03 PM UTC+1, Andy Fingerhut wrote: > > If you wanted to create a colle

Re: AOT and side-effects associated to ns initialization

2013-02-27 Thread Softaddicts
Of course, the expression needs to be evaluated at runtime only :) Presently, your jetty server gets started just after the expression is compiled. When you want to defer evaluation at runtime when generating compiled code ahead of time, you need to wrap expressions like these with this: (def ser

Re: AOT and side-effects associated to ns initialization

2013-02-27 Thread Víctor M . V .
Much clearer now :) Never heard of that *compile-files* var. Having to resort to it looks pretty nasty anyway - I'd rather refactor my code instead. Thanks for the answer Luc! On Thu, Feb 28, 2013 at 2:44 AM, Softaddicts wrote: > Of course, the expression needs to be evaluated at runtime only :)

Re: (def newsletter)

2013-02-27 Thread juan.facorro
Pretty cool. Have you subscribed and recieved any newsletter yet? If so, what do you think of the content? Thanks! J On Wednesday, February 27, 2013 2:49:01 PM UTC-3, Rich Morin wrote: > > I just ran across this and don't see anything about it in my list > archives, so... > > (def newslette

Re: (def newsletter)

2013-02-27 Thread Sean Corfield
You can click to see the archives: http://us2.campaign-archive2.com/home/?u=62fb70be840779d7af85e9b6e&id=4951b7aa7c On Wed, Feb 27, 2013 at 6:26 PM, juan.facorro wrote: > Pretty cool. Have you subscribed and recieved any newsletter yet? If so, > what do you think of the content? > > Thanks! > > J

Re: (def newsletter)

2013-02-27 Thread juan.facorro
I subscribed and completely missed the "Check out the archives" link. Thanks! On Wednesday, February 27, 2013 11:54:57 PM UTC-3, Sean Corfield wrote: > > You can click to see the archives: > > http://us2.campaign-archive2.com/home/?u=62fb70be840779d7af85e9b6e&id=4951b7aa7c > > > On Wed, Feb 27

Re: AOT and side-effects associated to ns initialization

2013-02-27 Thread Softaddicts
It's not nasty :) It's about cultural differences :) In the 70s/80s, dynamic languages were much more present than in the past 20 years. People understood the difference between interpretation vs code packaging for production use. Suspending evaluation at packaging time of some expressions is ok

Re: defmacro/gen-class/annotation woes

2013-02-27 Thread Meikel Brandmeyer (kotarak)
Hi, just a wild guess: quote the annotation in the macro. (with-meta name `{Deprecated true}). Note the backtick. Kind regards Meikel -- -- 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

Re: AOT and side-effects associated to ns initialization

2013-02-27 Thread Feng Shen
Hi, Another option: (ns you.ns // add :aot [you.ns] to project.clj (:gen-class)) (def server (atom nil)) (defn -main [& args]; command line args (reset! server (jetty/run-jetty #'app {:port 8000 :join? false}))) ;;; run it and pass command line arguments java -cp your-

Re: defmacro/gen-class/annotation woes

2013-02-27 Thread Paul Richardson
Meikel, Good guess - your idea works! I'm impressed. What made you think of that? How did you know to syntax-quote the metadata map? I'm curious how you solved it. Paul On Wednesday, February 27, 2013 11:52:05 PM UTC-7, Meikel Brandmeyer (kotarak) wrote: > > Hi, > > just a wild guess: quote

Re: defmacro/gen-class/annotation woes

2013-02-27 Thread Meikel Brandmeyer
Hi, if you want to avoid reflection in macro-generated code you have to quote the class because the compiler expects the classname and not the class itself. I figured it could be similar here. Kind regards Meikel -- -- You received this message because you are subscribed to the Google Groups "