Re: assertion-forms inside macros without using eval?

2013-02-21 Thread Jim foo.bar
Hi Meikel, This seems to work but returns nil and so you can't see that a new var has been defined! cluja.core=> (defcomponent maxent-person maxent) nil cluja.core=> maxent-person ;;was it defined? # ;;yes it was! Jim On 21/02/13 14:42, Meikel Brandmeyer (kotarak) wrote:

Re: assertion-forms inside macros without using eval?

2013-02-21 Thread Jim foo.bar
Yes you're right, this does the trick...However now I've ended up unquoting 'name' 3 times! I'm pretty sure this not a good practice in general, is it? On the other hand I cannot use 'gensym' cos I want the name intact or later access...hmmm...I never expected

Re: assertion-forms inside macros without using eval?

2013-02-21 Thread Jim foo.bar
Moreover, now the exception thrown when the validation fails is not very informative! IllegalStateException Invalid reference state clojure.lang.ARef.validate (ARef.java:33) assert let's you speciy the message you want that is why I preferred it... Jim On 21/02/13 14:56, Jim fo

Re: assertion-forms inside macros without using eval?

2013-02-21 Thread Jim foo.bar
have everything can I? :) Jim On 21/02/13 14:51, AtKaaZ wrote: I think the assert is working but either something eats up the thrown exception silently which would explain why def isn't reached, OR the defcomponent is never called, OR it is called with a different name param as you'd h

Re: Creating a hash-map with conditional keys

2013-02-21 Thread Jim - FooBar();
replaced by functions. Jim On 21/02/13 17:11, Ryan wrote: I got confused a bit with the reason that a macro would not be appropriate for this case. Can you please explain again? Ryan On Thursday, February 21, 2013 7:05:11 PM UTC+2, Alex Baranosky wrote: A function could be appropriate, but

protocol granularity

2013-02-23 Thread Jim - FooBar();
stanfordNLP consumer will most likely use the StanfordCoreNLP class to create the single-annotators...Consequently, his 'components' will also satisfy IWorkflow (because StanfordCoreNLP inherits from AnnotationPipeline), which is not desirable... any thoughts? Jim -- -- You received this message

creating code stubs to use inside an extend-protocol form

2013-02-23 Thread Jim - FooBar();
Class clojure.core/implements? (core_deftype.clj:512) any macro-gurus around? Jim -- -- 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 - pl

Re: creating code stubs to use inside an extend-protocol form

2013-02-24 Thread Jim - FooBar();
I'll just assume this is the way to go...I also didn't want to bring in external dependencies as I'm preparing an nlp-lib that acts like glue between several java nlp libs out there... something like U-Compare but on the API level...the less dependencies the better :) Jim On 24

attaching doc-string from macro is driving me insane!

2013-02-24 Thread Jim - FooBar();
his workflow has not been documented...")] (def ~(with-meta name (assoc (meta name) :doc ds#)) ~@syms))) ;;fails with CompilerException java.lang.RuntimeException: Unable to resolve symbol: ds# in this context, compiling:(NO_SOURCE_PATH:5:26) why is it so hard? I've been trying for almost

Re: attaching doc-string from macro is driving me insane!

2013-02-24 Thread Jim - FooBar();
I tried with eval, tried the let inside and outside the syntax-quote - I've tried everything! This is so frustrating! Jim On 24/02/13 18:24, AtKaaZ wrote: ds# inside the def is inside a ~() which means it's expected to exist outside of the ` like: (defmacro ... (let [ds#

Re: attaching doc-string from macro is driving me insane!

2013-02-24 Thread Jim - FooBar();
l false]) ds (if (second cs) doc "This workflow has not been documented...")] (assert (every? component? (first cs)) "Can only accept IComponents") `(def ~(with-meta name (assoc (meta name) :doc ds)) (Workflow. '~(first cs) {:description ~ds} nil Time for a

Re: attaching doc-string from macro is driving me insane!

2013-02-24 Thread Jim - FooBar();
On 24/02/13 19:44, AtKaaZ wrote: you can maybe do with just (vec components) instead of (vector ~@components) nice one! it works :) Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: attaching doc-string from macro is driving me insane!

2013-02-24 Thread Jim - FooBar();
On 24/02/13 19:44, AtKaaZ wrote: The problem is that you cannot catch that assert if it throws, ie. inside a deftest - just because it happens at compile time... a deftest will have its own top-level assertion...this is for client usage -- -- You received this message because you are subscr

was there a time when clojure empty seqs were falsy?

2013-02-25 Thread Jim - FooBar();
the empty set back as (known [word] *nwords*) returns something truthy (the empty set)... so it seems that at the time Rich wrote this empty seqs evaluated to false...Is this true? [1] http://en.wikibooks.org/wiki/Clojure_Programming/Examples/Norvig_Spelling_Corrector Jim -- -- You re

Re: was there a time when clojure empty seqs were falsy?

2013-02-25 Thread Jim - FooBar();
I see... thanks a lot! :-) Jim On 25/02/13 12:34, David Powell wrote: Some time before the release of Clojure 1.0, there didn't used to be any such thing as an empty sequence. You either had a (lazy) sequence, or nil. This made it easy to use sequences as emptiness tests, but had the

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

2013-02-27 Thread Jim foo.bar
e are more." {:added "1.0" :static true} ([x] x) ([x & more] x)) Jim -- -- 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 moder

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

2013-02-27 Thread Jim foo.bar
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? the idea is to we keep the same semantics as we currently have... Jim -- -- You received this message because you are subscrib

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 Jim foo.bar
y it would be confusing to just return the first arg...what exactly makes no sense? Jim -- -- 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 modera

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

2013-02-27 Thread Jim foo.bar
y) token-seq) As you can see I am sort of creating my own version of identity (fn [span _] span) because I cannot use 'identity' with 2 args. This is my use-case...It should make sense now yes? Jim -- -- You received this message because you are subscribed to the Google Groups "

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

Re: problem redefining protocols and records in emacs+nrepl

2013-02-27 Thread Jim - FooBar();
... 2)Do your protocols exist in a separate namespace? Are you reloading the namespace after making changes? Could you provide a minimal example of the problem? I've been using protocols quite heavily lately and I do remember some of these issues but I can't pinpoint your exact prob

what on earth is happening?

2013-02-28 Thread Jim foo.bar
' + 'load' but only *some* times. Most times it doesn't complain ! I'm not AOT-ing... Jim -- -- 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 t

Re: what on earth is happening?

2013-02-28 Thread Jim foo.bar
I mean it occurs at random...Has anyone ever had this before? @Dave: You're absolutely right Dave, I should have been be more specific in the subject heading. I do apologise though on behalf of my frustration which is to blame for this! It won't happen again Jim -- -- You receiv

Re: what on earth is happening?

2013-02-28 Thread Jim foo.bar
e 1st day that it manifested! Also, I'm nowhere near at understanding why sometimes it worked and other times it throwed! Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegr

Re: what on earth is happening?

2013-02-28 Thread Jim foo.bar
threw)... hehe :) Jim On 28/02/13 15:21, Marko Topolnik wrote: Nondeterministic behavior -> suspect race conditions. Maybe compilation was happening concurrently on several threads and the resulting bytecode got mangled. On Thursday, February 28, 2013 4:17:52 PM UTC+1, Jim foo.bar wrote:

Re: what on earth is happening?

2013-02-28 Thread Jim foo.bar
w. (help/link this pos other))) ;(run [this] (deploy this)) (run [this text] (deploy this text) ;(reduce #(run %2 %) text components)) ;(run [this text & more] (deploy this text (first more))) clojure.lang.IFn ;;can act as an fn (invoke [this arg] (deploy this arg)) (applyTo [this args] (apply deploy

Re: what on earth is happening?

2013-02-28 Thread Jim - FooBar();
al project has practically no dependencies! All that stuff I need to test what I'm doing. I'm providing the glue (the protocols and the extension-points) for several NLP libraries...after I'm done with each library, I need to pull it in and use it exactly as a consumer would. A

Re: what on earth is happening?

2013-02-28 Thread Jim - FooBar();
ve openJDK a spin... Clojure seems rather sure it is my record definition...but if I try to load the namespace containing the record everything is fine...it is the 'consumer' namespace (workflows.clj) that doesn't load (sometimes)... Jim On 28/02/13 17:20, Softaddicts wrote: Did

Re: what on earth is happening?

2013-02-28 Thread Jim - FooBar();
n previously defined .These are characteristic of the problems inheritance introduces in Java. I had similar problems with stanforNLP and I did post here (protocol granularity was the name of the post). Jim -- -- You received this message because you are subscribed to the Google Groups "Clojur

Re: what on earth is happening?

2013-02-28 Thread Jim - FooBar();
rains to realise that you are very knowledgeable and always have good insights/suggestions so I'm only trying to learn. Jim On 28/02/13 18:05, David Nolen wrote: On Thu, Feb 28, 2013 at 1:00 PM, Jim - FooBar(); <mailto:jimpil1...@gmail.com>> wrote: On 28/02/13 17:29, David

Re: what on earth is happening?

2013-02-28 Thread Jim - FooBar();
case lein2 check succeeds every time...or at least it hasn't failed yet! Jim -- -- 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

[ANN] Immutant 0.9.0 released

2013-02-28 Thread Jim Crossley
Ring handlers, asynchronous messaging, caching, scheduled jobs, XA transactions, clustering, and highly-available "daemon" services. Peace, Love, and Oysters, Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

fully populated protocols (or not)?

2013-03-01 Thread Jim - FooBar();
on't have to repeat code (I guess something similar to the 'with-open' macro). Is my understanding that wrong? thanks a lot in advance, Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gr

Re: fully populated protocols (or not)?

2013-03-01 Thread Jim - FooBar();
(not implementing some fn)? Jim On 01/03/13 14:25, Softaddicts wrote: Precisely David and I were making a point specifically about methods with multiple arities in the same protocol. I do have protocols partially implemented on some occasions and there's no problem with that. The runtime error is q

Re: fully populated protocols (or not)?

2013-03-01 Thread Jim - FooBar();
ed to accommodate the peculiarities of several 'alien-between-them' librabries, I almost always find the need for multiple arities... Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloj

Re: problem redefining protocols and records in emacs+nrepl

2013-03-01 Thread Jim - FooBar();
On 01/03/13 15:44, Joachim De Beule wrote: When I change the number of slots in a record, e.g. from (defrecord MyRecord [slot1 slot2] ...) to (defrecord Myrecord [slot1] ...) are you reloading the namespace between these steps? Jim -- -- You received this message because you are

Re: problem redefining protocols and records in emacs+nrepl

2013-03-01 Thread Jim - FooBar();
on my bare repl so I'll assume something is wrong in your setup/enviroment...unfortunately I cannot help there... user=> (defrecord Foo [a b]) user.Foo user=> (Foo. 1 2) #user.Foo{:a 1, :b 2} user=> (defrecord Foo [a]) user.Foo user=> (Foo. 1) #user.Foo{:a 1} ;;all good J

Re: Possible to suppress some stderr output?

2013-03-05 Thread Jim - FooBar();
I don't know if you can suppress it, but you can certainly ignore it with 'without-str' which will give you what was supposed to be printed out, as a string...then it's up to you what to do with it... :) HTH, Jim On 05/03/13 08:56, bruce li wrote: Hi, guys, I'm

Re: Possible to suppress some stderr output?

2013-03-05 Thread Jim - FooBar();
aaa sorry...I guess I should have tested first... Jim On 05/03/13 14:24, bruce li wrote: Thanks, Jim. But with-out-str only works for output to *out*(stdout), but not *err*(stderr). A quick test is: (with-out-str (try (throw (Exception. "Hello"))

Re: Possible to suppress some stderr output?

2013-03-05 Thread Jim - FooBar();
[s# (new java.io.StringWriter)] (binding [*out* s# *err* s#] ~@body (str s# Jim On 05/03/13 14:33, Jim - FooBar(); wrote: aaa sorry...I guess I should have tested first... Jim On 05/03/13 14:24, bruce li wrote: Thanks, Jim. But with-out-str only works for output to *out*(s

Re: Possible to suppress some stderr output?

2013-03-05 Thread Jim - FooBar();
still doesn't work though! strange... why would you want to do this anyway? Jim On 05/03/13 14:35, Jim - FooBar(); wrote: but then it's pretty trivial to adapt it: (defmacro with-out-err-str "Evaluates exprs in a context in which *out* and *err* ire bound to a fresh

Re: Possible to suppress some stderr output?

2013-03-05 Thread Jim - FooBar();
On 05/03/13 14:50, bruce li wrote: What is the difference between *err* and System/err?! its the same but wrapped in a PrintWriter http://richhickey.github.com/clojure/clojure.core-api.html#clojure.core/*err* Jim -- -- You received this message because you are subscribed to the Google Groups

how does one embed nrepl in his own application?

2013-03-05 Thread Jim - FooBar();
s etc makes the bare repl a rather horrific experience... thanks in advance, :) Jim -- -- 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 mode

Re: Possible to suppress some stderr output?

2013-03-05 Thread Jim - FooBar();
I can see why you would think that but it would be the same story for *out* wouldn't it. Noone redirects System.out when you bind *out* to some writer, however still it works... I don't exactly have time to look into this now but I may do this afternoon :) Jim On 05/03/13 15:07

Re: how does one embed nrepl in his own application?

2013-03-05 Thread Jim - FooBar();
wow! that is 10 times easier than I expected...I guess I'll have to ditch the socket-based approach... thanks Martin :) Jim On 05/03/13 15:22, Weber, Martin S wrote: $ lein new replbuiltin && cd replbuiltin $ sed -Ee 's,.0",.0"][org.clojure/tools.nrepl "0.2.

Re: how does one embed nrepl in his own application?

2013-03-05 Thread Jim - FooBar();
this is brilliant, thanks a lot! Jim On 05/03/13 15:45, Chas Emerick wrote: See https://github.com/clojure/tools.nrepl#embedding-nrepl-starting-a-server Cheers, - Chas -- http://cemerick.com [Clojure Programming from O'Reilly](http://www.clojurebook.com) On Mar 5, 2013, at 10:03 AM

Re: how does one embed nrepl in his own application?

2013-03-05 Thread Jim - FooBar();
ccess, and it doesn't work! I don't get the repl upon connection... Do i need to do anything extra after starting the server? Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojur

Re: how does one embed nrepl in his own application?

2013-03-06 Thread Jim - FooBar();
with a tty transport which however is not the default ...in a nutshell, if someone wants to use telnet, he has to start the server with the extra arg ':transport-fn tty'...then it works just fine but the experience is still horrific Jim -- -- You received this message because you a

Re: nameclashes with java.lang

2013-03-06 Thread Jim - FooBar();
On 06/03/13 10:41, Phillip Lord wrote: Is there no equivalent to :refer-clojure for java.lang? I think java.lang is imported by the ns macro...if you don't use it then you don't get java.lang.* Jim -- -- You received this message because you are subscribed to the Google Group

Re: how does one embed nrepl in his own application?

2013-03-06 Thread Jim - FooBar();
On 06/03/13 19:30, Sean Corfield wrote: What's your use case that you'd have folks connecting into the nrepl server without a regular nrepl client? I was just curious about minimal ways of connecting remotely...installing lein might not always be an option. Jim -- -- You rec

Re: Model-View-Controller in Clojure?

2013-03-09 Thread Jim - FooBar();
tom and it changes after every move. All changes are being logged to 'board-history'. Starts off as nil but we can always get the initial board arrangement from core." (-> (atom nil) (add-watch :log (partial core/log-board core/board-history) HTH, Jim ps: my examp

Re: Model-View-Controller in Clojure?

2013-03-09 Thread Jim - FooBar();
also see this for a discussion about why the need for design patterns almost disappears in Clojure: http://stackoverflow.com/questions/8902113/clojure-model-view-controller-mvc-design Jim On 09/03/13 14:24, Jim - FooBar(); wrote: You need to store your model in a ref-type (atom,agent,or ref

Re: :use an entire namespace full of protocols or stick with :require?

2013-03-10 Thread Jim - FooBar();
no I don't have to :import them...I need the namespace loaded and then I need access to all the protocol vars (both can be achieved with :require)...The concrete records need importing by the consumer, if that's what you mean... Jim On 10/03/13 11:18, Marko Topolnik wrote: Isn'

Re: :use an entire namespace full of protocols or stick with :require?

2013-03-10 Thread Jim - FooBar();
gives any insight about what is being brought in...my understanding is that since they do the same (bad) thing, let's stop using one of them... so given this, my question can be re-phrased as ":use/[:require :refer:all] an entire namespace full of protocols or stick with [:require

Re: :use an entire namespace full of protocols or stick with :require?

2013-03-10 Thread Jim - FooBar();
7;re bringing in. I could argue that :use :only is a lot better than :require :refer :allin other words, burying :use doesn't mean that suddenly :require :refer :all is good...it is equally bad as a bare :use... in my case though, I will most likely use all the vars (eventually), henc

Re: :use an entire namespace full of protocols or stick with :require?

2013-03-10 Thread Jim - FooBar();
ey will only be used in a couple of places, mainly in the 'concretions' namespace...to be honest, at the moment I'm using :refer :all simply because I'd need the characters 'pro/' more than 300 times in that namespace...it would actually make readability worse in my

Re: Model-View-Controller in Clojure?

2013-03-10 Thread Jim - FooBar();
n less than 8sec with an average branching factor of 26. In the best case, pruning can cut this down in half which sounds pretty impressive if I ever manage it! Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post t

Re: fold over a sequence

2013-03-11 Thread Jim foo.bar
ult of xml/parse and then use fold on that? Is it a massive seq? Jim On 11/03/13 00:40, Paul Butcher wrote: As things currently stand, fold can be used on a sequence-based reducible collection, but won't be parallel. I'm currently working on code that processes XML generated by

Re: What's the point of -> ?

2013-03-11 Thread Jim foo.bar
s nesting (e.g: (-> m :some-key (+ 1))). I guess for such occasions it is purely a mater of taste... Jim -- -- 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 f

Re: Get difference between two lists with java objects of same class

2013-03-11 Thread Jim - FooBar();
tty trivial to find the difference. alternatively, you can pour the lists into 2 clojure sets and take their proper difference (but this will remove duplicates as well)... I'm not sure what you mean 'compare those lists based on a key' though... Jim On 11/03/13 18:15, Ryan wr

Re: Get difference between two lists with java objects of same class

2013-03-11 Thread Jim - FooBar();
On 11/03/13 18:35, Jim - FooBar(); wrote: Well, java.util.List specifies a retainAll(Collection c) method which is basically the intersection between the 2 collections (the Collection this is called on and the argument). You are actually looking for the 'difference' but if yo

Re: Get difference between two lists with java objects of same class

2013-03-11 Thread Jim - FooBar();
l back to java's broken equality semantics? If you use removeAll() you automatically lose the ability to make such decisions for yourself... :-) Jim On 11/03/13 19:35, Ryan wrote: Hey Jim, Thanks for your replies for starters. Indeed I do not care what will happen to the original lists,

Re: Get difference between two lists with java objects of same class

2013-03-11 Thread Jim - FooBar();
%) {:ob %} nil) java-util-list-with-objects1)) (set (map #(TEMP. (.getId %) {:ob %} nil) java-util-list-with-objects2)) ) ) ;;half way there (def step2 (for [t step1] (-> t meta :ob))) ;;not tested but seems reasonable doesn't it? hope that helps... Jim ps: now that I look at it maybe a

Re: Model-View-Controller in Clojure?

2013-03-12 Thread Jim - FooBar();
t seesaw...you won't have to use watchers there as you can specify what to 'listen' for and how to react on events with higher order functions...this is exactly the reason my board-history atom doesn't have a :on-update watch and only bothers with logging...I'm taking

strange interop behaviour/issue

2013-03-12 Thread Jim - FooBar();
overload ,whereas I'm trying to invoke the second one!!! If I omit the 'nil' at the end , the correct method is invoked (the first which calls the second)...why can't Clojure find the second overload and goes for the 3rd? any ideas? Jim -- -- You received this message b

Re: strange interop behaviour/issue

2013-03-12 Thread Jim - FooBar();
OSTaggerME respectively) how on earth can that be? any ideas anyone? this seems utterly odd to me! Jim On 12/03/13 13:26, Jim - FooBar(); wrote: Hi all, I came back to a project of mine after a week or so and I'm facing a problem which I have no idea where it came from! This i

someClass.getMethods() misses 2 public methods! how is that even possible?

2013-03-12 Thread Jim - FooBar();
the title says it all...I'm left speechless! see my previous post for details ("strange interop behaviour/issue") thanks in advance for any insight... Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

Re: strange interop behaviour/issue

2013-03-12 Thread Jim - FooBar();
claredMethods() even though they are both public! Having decompiled the jar I can confirm that the 2 methods are indeed present! In fact I was using them a week ago! I'm at a loss here...any help will be greatly appreciated... Jim -- -- You received this message because you are subscribed to t

Re: Model-View-Controller in Clojure?

2013-03-12 Thread Jim - FooBar();
not (:block? @knobs)) (realized? curr-game)) (canva-react @curr-game e)))] )) If your state transformation doesn't depend on user input then your watch-approach is fine... :) Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. T

Re: strange interop behaviour/issue

2013-03-12 Thread Jim - FooBar();
ec I'll get back to you... Jim On 12/03/13 14:49, David Powell wrote: It looks like: public String[] tag(String[] sentence, Object[] additionaContext); wasn't originally present in the API, and was added in: http://svn.apache.org/viewvc/opennlp/trunk/opennlp-tools/src/

Re: strange interop behaviour/issue

2013-03-12 Thread Jim - FooBar();
David you are a genious!!! thank you thank you very much!!! one of my dependencies was pulling in opennlp/tools 1.5.0 which is a 2 year old jar!!! added :exclusions and now I'm back in the game If you're in Manchester Uk I'm buying beer... :) Jim On 12/03/13 14:49, David Po

Re: fold over a sequence

2013-03-13 Thread Jim foo.bar
how come your project depends on the problematic version 1.5.0? Jim On 13/03/13 14:03, Paul Butcher wrote: Thanks Stuart - my Contributor Agreement is on its way. In the meantime, I've published foldable-seq as a library: https://clojars.org/foldable-seq I'd be very interes

Re: fold over a sequence

2013-03-13 Thread Jim foo.bar
there was a memory leak hence the 1.5.1 release the next day... Jim On 13/03/13 14:12, Paul Butcher wrote: On 13 Mar 2013, at 14:05, "Jim foo.bar" <mailto:jimpil1...@gmail.com>> wrote: how come your project depends on the problematic version 1.5.0? 1.5.0 is problemati

Re: Apparent interaction of libraries with lein

2013-03-14 Thread Jim foo.bar
Could it be that you're using lein1 instead of lein2? Is lein1 still actively maintained? In any case I suggest you upgrade to lein2... Jim On 14/03/13 12:48, Nico Swart wrote: The Leiningen project file I use include these dependancies: (defproject fb20try "1.0.0-SNAPSHOT"

Re: Can I get a string like ":cities" as a keyword without getting the double "::"?

2013-03-17 Thread Jim - FooBar();
On 17/03/13 18:42, larry google groups wrote: (st/replace (str (:name item)) #":" "") #(apply str (next %)) Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googleg

Re: Can I get a string like ":cities" as a keyword without getting the double "::"?

2013-03-17 Thread Jim - FooBar();
aaa of course, if you do want to *read* the keyword in, use read-string...there is no point in getting rid of the ':' and then essentially re-inserting it! Jim On 17/03/13 18:51, JvJ wrote: Use read-string. user> (read-string ":cities") :cities On Sunday, 17 Ma

contrib.monads doesn't compile?

2013-03-18 Thread Jim - FooBar();
d and I thought you should know... Jim -- -- 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.

nested map destructuring

2013-03-19 Thread Jim - FooBar();
Hello all, can anyone help me destructure the following map in order to access directly w1 w2 & w3 ? I've been trying for 20 minutes now! (how useless am I? :( ) {:weights {:w1 0.2 :w2 0.3 :w3 0.5} :uni-probs {...} :bi-probs {...} :tri-probs {...}} thanks, Jim -- -- You rece

Re: nested map destructuring

2013-03-19 Thread Jim - FooBar();
On 19/03/13 19:49, Marko Topolnik wrote: {{:keys [w1 w2 w3]} :weights} awsome!...the full thing actually is {{:keys [w1 w2 w3]} :weights u :uni-probs b :bi-probs t :tri-probs} I always get confused when the order changes like that...thanks for unblocking me Marko :) Jim -- -- You

Re: nested map destructuring

2013-03-19 Thread Jim - FooBar();
nice one...when thinking like there is literally no confusion. thank you thank you thank you :) Jim On 19/03/13 20:05, Marko Topolnik wrote: Think of it in layers, like this---layer 1: {w :weigths, u :uni-probs, b :bi-probs, t :tri-probs} Then, instead of an atomic w, recursively

Re: ANN: Illegal Argument podcast on Typed Clojure

2013-03-21 Thread Jim foo.bar
thanks guys! I enjoyed this.. :) Jim On 21/03/13 08:32, Mark Derricutt wrote: Hey all, We couldn't let everyone at Clojure/West have all the fun so our latest podcast is an awesome chat with Ambrose Bonnaire Sergeant all about Typed Clojure. http://illegalargument.com/illegal-arg

Re: doing a Google search from Clojure?

2013-03-22 Thread Jim - FooBar();
On 22/03/13 15:00, juan.facorro wrote: (do (.append sb (char c)) do you really need the 'do'? Jim -- -- 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 po

Re: doing a Google search from Clojure?

2013-03-22 Thread Jim - FooBar();
On 22/03/13 15:20, Jim - FooBar(); wrote: On 22/03/13 15:00, juan.facorro wrote: (do (.append sb (char c)) do you really need the 'do'? Jim ooops! I'm really sorry! my bad! JIm -- -- You received this message because you are subscribed to the Google Groups "Clojur

Re: LoL which style for Clojure

2013-03-22 Thread Jim - FooBar();
def/defn et. al are top-level form definitions...very rarely (I'd say never) you'd have a def/defn inside a 'let' or inside anything for that matter...The 1st one looks good :) Jim On 22/03/13 18:59, jamieorc wrote: Curious which style is preferred in Clojure and why: (

let-timed macro...any suggestions/corrections?

2013-03-23 Thread Jim - FooBar();
list 'time (second %)) parts)] ;;don't time at compile-time, just build the timing expression for later use `(let ~(vec (interleave names results)) ;;the new bindings ~@code))) Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure

Re: let-timed macro...any suggestions/corrections?

2013-03-24 Thread Jim - FooBar();
%)) parts)] `(let ~(vec (interleave names results)) ~@body))) Jim -- -- 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 b

strange behaviour

2013-03-24 Thread Jim - FooBar();
size and I'm performing the same operation on them_... the only difference is that 'tags' contains String objects whereas 'tt-pairs' contains TokenTagPair objects... weird stuff, yes? any ideas anyone? Jim -- -- You received this message because you are subscribed to

Re: strange behaviour

2013-03-24 Thread Jim - FooBar();
e final coll should be of the same size in both cases and should terminate in the same time... Jim On 24/03/13 13:22, Marko Topolnik wrote: What do you mean by "performing the same operation"? How can you perform the same operation on completely different objects? Do you mean tha

Re: strange behaviour

2013-03-24 Thread Jim - FooBar();
as expected...the weirdness is that it takes more than forever whereas with strings it finishes quickly! Jim On 24/03/13 13:35, Jim - FooBar(); wrote: the operation is 'ngrams*' which doesn't care about what objects it finds in the seq...Typically you'd have characters o

Re: strange behaviour

2013-03-24 Thread Jim - FooBar();
wow! this is even stranger now!!! I removed the call to count from ngrams* and now the same thing happens but all 4 cpus are busy!!! I don't understand... Jim On 24/03/13 13:54, Marko Topolnik wrote: May or may not be related, but calling /count/ on a lazy sequence eagerly consume

Re: strange behaviour

2013-03-24 Thread Jim - FooBar();
Dpairs)) (def tag-ngrams (doall (ngrams* Dtags 2)));;all good (def pair-ngrams (doall (ngrams* Dpairs 2)));;this hangs now redefine ngrams* without the 'count' and try the last 2 statements...check your cpus... Jim On 24/03/13 14:04, Jim - FooBar(); wrote: wow! this is even

Re: strange behaviour

2013-03-24 Thread Jim - FooBar();
ooo I found this: http://stackoverflow.com/questions/10565874/non-linear-slowdown-creating-a-lazy-seq-in-clojure I did not post this but this guy came up with the same solution... Jim ps: the 'partition' solution does seem much better... On 24/03/13 14:17, Jim - FooBar(); wrote: i

Re: Concurrency and custom types.

2013-03-24 Thread Jim - FooBar();
of course you can... however be careful of what you mean immutable in Java. Declaring fields as final doesn't make them immutable unless they point to something immutable (a value). if they do, make sure you override .equals() appropriately and you're good to go... :) Jim On 2

Re: Concurrency and custom types.

2013-03-24 Thread Jim - FooBar();
27;s reference types with something mutable? there is nothing to be gained from that, is there? the indirection of vars/refs only makes true sense when dealing with values and pure functions... Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: Concurrency and custom types.

2013-03-25 Thread Jim foo.bar
I spent the most time on was the foundation of Clojure - its data-structures. I basically concluded that this is the 1 thing in Clojure that essentially makes everything else play nicely... I feel slightly 'betrayed' now...ok 'betrayed' may be a bit of a stretch but you get the id

Re: Concurrency and custom types.

2013-03-25 Thread Jim foo.bar
27; or 'atomic' we expect certain properties by default - not by convention... Jim -- -- 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 ar

Re: Concurrency and custom types.

2013-03-25 Thread Jim foo.bar
ivate & final within a class, is there a way to mutate it? I do find this very scary, even in Java as it contradicts certain things we take for granted... Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, se

Re: Concurrency and custom types.

2013-03-25 Thread Jim foo.bar
://www.azulsystems.com/blog/cliff/2011-10-17-writing-to-final-fields-via-reflection Jim -- -- 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

Re: Concurrency and custom types.

2013-03-25 Thread Jim foo.bar
On 25/03/13 12:50, Shantanu Kumar wrote: However, I'd consider they are just implementation details and intended for idiomatic use from within the Clojure language. I think you meant "*not* intended for idiomatic use from within the Clojure language." Jim -- -- You receiv

<    1   2   3   4   5   6   7   8   9   10   >