Thread.currentThread().getContextClassloader(), assuming of
course that you're working on a Clojure project...
Jim
ps: I have no idea what Xalan Saxon are and what your code is trying
to do, but this particular paragraph of yours screams class - loading
issues...
--
--
You received this message
On 15/05/13 17:23, Phillip Lord wrote:
I cannot do
(set!*my-test* true)
(alter-var-root #'*my-test* (constantly true))
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
On 15/05/13 17:28, Jim - FooBar(); wrote:
On 15/05/13 17:23, Phillip Lord wrote:
I cannot do
(set!*my-test* true)
(alter-var-root #'*my-test* (constantly true))
Jim
here explains what you're asking:
http://clojure.org/Vars
scroll down to until you see
(*set!*var-symbol expr
many thanks for this! :)
btw, is there any place where one can find your discussion between you
and Christophe? I'd love to know more about equiv...alternatively, do
you plan on making public what you've learned in some sort of demo/tutorial?
Jim
On 14/05/13 09:29, Mark Engelberg wrote
So the following is not encouraged because we disregard the result of
calling seq?
(def dummy
{:a [1 2 3]
:b [4 5 6]
:c []
})
=(every? seq (vals dummy)) ;make sure all values are non-empty
false
Jim
On 13/05/13 15:08, Meikel Brandmeyer (kotarak) wrote:
Hi,
Am Montag, 13. Mai 2013
' etc. claws into me though,
so it is with trepidation I set out on this gloriously liberating new
path :).
the mindset you're describing is a direct consequence of unrestrained
mutability ...nothing bad can happen to your *immutable* clojure data
:)... very liberating indeed!
Jim
--
--
You
not to use any
reference types.
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.
To unsubscribe
something like this perhaps?
(loop [[c more]] cards
res []
due 100]
(if-not c res
(recur more
(conj res (doto c (.setAppliedBalance (max 0 (- due )
(- due (.getBalance c )
Jim
ps: haven't got a clue what objects you're working with so I'm
oops there is a typo!
line 6 should be:
(conj res (doto c (.setAppliedBalance (max 0 (- due (.getBalance c))
On 03/05/13 15:22, Jim - FooBar(); wrote:
something like this perhaps?
(loop [[c more]] cards
res []
due 100]
(if-not c res
(recur more
(conj res
I Just realised you've many responses and that you've already solved
your problem...sorry for the noise people.
Jim
On 03/05/13 15:38, Jim - FooBar(); wrote:
oops there is a typo!
line 6 should be:
(conj res (doto c (.setAppliedBalance (max 0 (- due (.getBalance c))
On 03/05/13 15:22
I enjoyed watching this so I thought I'd share...
http://www.infoq.com/presentations/Scala-Spire
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
you need, have been
implemented/ported to clojure-py...My guess would be not all of them have...
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
I 've found that whenever I get a var-unbound exception it is almost
always my fault and my fault only...why would you do (def a) anyway?
Jim
On 29/04/13 16:32, AtKaaZ wrote:
How do you guys handle the cases when the var is unbound? I mean
specifically in the cases where you just test
funny you should mention that!!! that is exactly what I meant by 'my
fault'...I've come to realise that dynamic scope is almost evil, thus I
go to great lengths to avoid it completely...in the rare cases where I
do use it I always make sure it is bound to a init/default value :)
Jim
On 29
+1 ! I use 'fold-into-vec' regularly :)
Jim
On 26/04/13 18:07, Alan Busby wrote:
Some additional pointers here (this is a little old though);
http://www.thebusby.com/2012/07/tips-tricks-with-clojure-reducers.html
On Fri, Apr 26, 2013 at 11:51 PM, László Török ltoro...@gmail.com
from the classloader
+ the Class object...
any ideas?
thanks,
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
tried both... nothing worked... :(
Jim
On 26/04/13 20:16, Jonathan Fischer Friberg wrote:
Did you put / at the beginning of the string to resource? Because
you shouldn't.
You should call it like this: (resource foo.xml).
Jonathan
On Fri, Apr 26, 2013 at 8:47 PM, Jim - FooBar(); jimpil1
to reduce the incidental complexity in
real-world applications. It provides support for Ring handlers,
asynchronous messaging, caching, scheduled jobs, XA transactions,
clustering, and highly-available daemon services.
Thanks,
Jim
--
--
You received this message because you are subscribed
I've also had problems passing classes that reside to memory to apache
UIMA or instantiation. What worked for me is this:
(def dynamic-classloader (. (Thread/currentThread)
getContextClassLoader)) (Class/forName mypackage.myclass true
dynamic-classloader)
Jim
On 24/04/13 13:39, Gary
very similar timings from these 2 versions as the
type-hinted arg 'l' is never used anywhere - you're just returning nil...
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
It sounds to me that you forgot to run 'lein clean' at work, leaving
certain classfiles present in 'target'. This would explain why you got
your uberjar at work but not at home (presumably .class files are being
ignored by git)
Jim
On 16/04/13 13:59, larry google groups wrote:
I have a Mac
the types does nothing - it seems proxy only cares about arity
void bar(InterfaceX ix); //*not *supposed to be overriden
abstract void bar(InterfaceY iy); //but this is indeed supposed to be
overriden
Should I just give up?
Jim
--
--
You received this message because you are subscribed
use it!)...
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.
To unsubscribe from this group
On 15/04/13 21:37, Meikel Brandmeyer (kotarak) wrote:
(proxy [YourClass BarInterface] []
(bar [x-or-y]
(if (instance? InterfaceY x-or-y)
(override x-or-y)
(proxy-super x-or-y
I'm sorry I forgot...what is 'override' above? what fn is this? I cannot
find docs...
Jim
aaa ok sorry... proxy-super is a no-no in this case...I think at this
point my best bet is to write a macro that will expand into a gen-class
skeleton form...there is no other way I'm afraid...the proxy approach
would be so elegant if it worked!
Jim
On 15/04/13 22:17, Meikel Brandmeyer
Nice talk :)
http://skillsmatter.com/podcast/scala/clojure-at-nokia-entertainment/wd-23
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
!))**
**
**
=hotel_nlp.externals.uima.proxy$org.uimafit.component.JCasAnnotator_ImplBase$0*
What on earthis happening? How am I able to get the class Object back
but the ClassLoader couldn't? This is very weird isn't it?
any insights would be great! :)
Jim
--
--
You received this message because you
I found this on SO which seems to be related but the answer proposes
deftype which is not an option for me as I need to extend a particular
class with proxy... I'm completely stuck...
Jim
On 11/04/13 14:10, Jim - FooBar(); wrote:
Hi all,
I'm writing a tiny wrapper around apache UIMA
classloader and even if I could who knows what
kind of problems that would bring...
Jim
On 11/04/13 16:36, Jim - FooBar(); wrote:
I found this on SO which seems to be related but the answer proposes
deftype which is not an option for me as I need to extend a particular
class with proxy... I'm
since classes generated by proxy reside on memory how would the standard
java.net.URLClassolader find them? is there a way to emit the class on disk?
Jim
--
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure
...
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.
To unsubscribe from this group, send email
Hey Mark, don't get paranoid :)... this is all Cedric did!
user= (def .3 0.4)
#'user/.3
user= (+ .3 1.7)
2.1
Jim
On 09/04/13 10:46, Mark Engelberg wrote:
What version are you running?
As far as I know, .3 isn't even a valid representation for a number --
you'd have to write it as 0.3. So
if I understood correctly you're looking for 'fnil' :
=(update-in {} [:foo :bar] (fnil conj []) :a :b :c)
{:foo {:bar [:a :b :c]}}
Jim
On 05/04/13 12:25, Simon Katz wrote:
Hi.
Is there an idiomatic way to have update-in create a vector when the
supplied keys do not already exist? (Or maybe
aaa Laurent beat me to it! :)
it seems we both understood the same thing so fnil is indeed your friend...
Jim
On 05/04/13 12:29, Jim foo.bar wrote:
if I understood correctly you're looking for 'fnil' :
=(update-in {} [:foo :bar] (fnil conj []) :a :b :c)
{:foo {:bar [:a :b :c]}}
Jim
On 05
Thanks John,
I came up with this, which uses destructuring quite heavily and might
slow things down...
(reduce (fn [s [t1 t2 w3 v]] (assoc-in s [t1 t2 w3] (/ (count v) all))) {}
(for [[k1 v1] ems [k2 v2] v1 [k3 v3] v2] [k1 k2 k3 v3]))
is this what you meant?
Jim
On 03/04/13 19:54, John D
! both)))
Jim
On 04/04/13 13:16, Christian Romney wrote:
Hi all,
I was wondering if something in core (or new contrib) like this exists
already...
(defn segregate
Takes a predicate, p, and a collection, coll, and separates the items
in coll
into matching and non-matching subsets. Like Scheme
want go parallel...
you asked where to find this funciton... a couple of places actually :)
http://clojuredocs.org/clojure_contrib/clojure.contrib.seq-utils/separate
http://richhickey.github.com/clojure-contrib/seq-utils-api.html
HTH,
Jim
On 04/04/13 19:12, Christian Romney wrote
[ghostandthemachine/seesaw1.4.3-SNAPSHOT:exclusions[org.clojure/clojure]]
Jim
ps: maybe the actual coordinate for clojure is wrong but I can
On 05/04/13 00:32, Mark Engelberg wrote:
Right now, I'm experimenting with seesaw. In Clojars, it appears the
latest version is 1.4.2.
When I
work...has anyone done this already? It comes down to 'seq' returning a [k,v]
vector when called on a map so the second nesting level will break because it
will find a keyword or something similar. any ideas?
Jim
--
--
You received this message because you are subscribed to the Google
Groups
All you're doing is re-let(ing) the same name using the value with which
it'd been previously 'let'. It has nothing to do with mutability...if
you used a different name you'd see that nothing would happen to the
'first' mega value. Yes I'd say this is badly articulated Clojure...
Jim
On 02
)
and using dynamic vars heavily...
Jim
On 02/04/13 20:19, Jim - FooBar(); wrote:
All you're doing is re-let(ing) the same name using the value with
which it'd been previously 'let'. It has nothing to do with
mutability...if you used a different name you'd see that nothing would
happen
I'm sorry, I've not followed this discussion - what is wrong with
user=(apply str (interpose \, (list 1 2 3 4 5)))
1,2,3,4,5
the problem is strings where you want to preserve each string...you can
special case that and avoid the (apply str...) bit..
user= (interpose \, (list jim jon chris
Clojurescript is Clojure...you may be able to skip some JVM
idiosyncrasies but it's the same language - no way around that!
Jim
On 30/03/13 14:09, Nico wrote:
Thank you very much sw1nn and John, both worked great. This goes to
show how much of a newb I am.
Sorry if this is the wrong group
imagine it
shouldn't be too hard to do the same on the threading macros, cond etc.
Also if I face any problems there is always your code to guide me...
Jim
On 28/03/13 05:42, Alex Baranosky wrote:
print-foo is a small library useful when debugging code, or at the
REPL when writing your code
On 28/03/13 18:39, Alex Baranosky wrote:
Jim,
I'm interested in that idea definitely, but perhaps we should just
create another open source project for time.foo?
Ok cool, I'll do that over the weekend and poke you sometime next week
to have a look...also, have you deliberately left out
clojure.set/difference
'membero' combined with its negated form?
Jim
On 28/03/13 18:47, JvJ wrote:
In core.logic, how do the following: Give me everything that is a
member of list A and not a member of list B?
--
--
You received this message because you are subscribed to the Google
Groups
(at least for me)...
Jim
ps: by no means I meant read the source before posting here...my
comment was closer to read the sources - it's good for you - you'll
learn stuff and potentially save time effort :)
--
--
You received this message because you are subscribed to the Google
Groups Clojure
On 26/03/13 19:28, Ryan wrote:
apply the elements of my vector as arguments to the function
you said it yourself in your first post... :) 'apply' is what you're
looking for!
Jim
--
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post
:address.state]
or in your case exactly:
[:id]
[[:id :identity]] ;;with aliasing
is this how your 'fields-vector' looks like?
Jim
ps: I've not looked at the source of 'fields', I may be wrong...
On 26/03/13 20:12, Ryan wrote:
Thank you guys for your answer. apply was the first thing I used
aaa see? always check the docs first and the sources second (if
available)...I should have done that as well :)
Jim
On 26/03/13 20:28, Ryan wrote:
Ah damn, you are right! Sorry if I wasted anyone's time :)
At least I learned that apply was the way to go in my original post
On Tuesday
play nicely... I feel slightly 'betrayed' now...ok 'betrayed' may be a
bit of a stretch but you get the idea...I can no longer claim that
Clojure's collections are values, can I?
Jim
--
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post
- 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 are moderated - please be patient with your
first post.
To unsubscribe from this group
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, send email to clojure
://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 moderated - please
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 received this message
On 25/03/13 12:55, Michael Klishin wrote:
Take a look at https://blogs.oracle.com/jrose/entry/value_types_in_the_vm,
it indicates that there is interest in true value types on the JVM
but at best they will
make it in JDK 9 in 2015.
thanks for thisvery interesting stuff indeed... :)
Jim
understand why I get an integer overflow...
any ideas?
Jim
ps: this is not 'important', I'm just messing about...
--
--
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
On 25/03/13 15:22, Ben Wolfson wrote:
The 94th fibonacci number is greater than Long/MAX_VALUE, so it
overflows. It is using longs.
I seeshouldn't Clojure auto-promote it to a BigInt then?
Jim
--
--
You received this message because you are subscribed to the Google
Groups Clojure group
Cool, thanks guys :)
Jim
On 25/03/13 15:34, David Powell wrote:
On Mon, Mar 25, 2013 at 3:24 PM, Jim foo.bar jimpil1...@gmail.com
mailto:jimpil1...@gmail.com wrote:
On 25/03/13 15:22, Ben Wolfson wrote:
The 94th fibonacci number is greater than Long/MAX_VALUE, so
)]
`(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 be patient with your
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 the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts
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 that you don't have the exact same /ngrams*/ in the first and
second
ntt-pairs)
(#hotel_nlp.algorithms.viterbi.TokenTagPair{:token Fulton, :tag NP}
#hotel_nlp.algorithms.viterbi.TokenTagPair{:token County, :tag N})
so this proves it works as expected...the weirdness is that it takes
more than forever whereas with strings it finishes quickly!
Jim
On 24/03
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 consumes
(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 stranger now!!! I removed the call to count from
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'm getting
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 24/03/13 16
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 group.
To post to this group, send email
'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 group.
To post
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 posts from new members
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 Clojure group.
To post
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:
(defn f1 []
(let [x
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-argument
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 received
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
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
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.
To unsubscribe from
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@googlegroups.com
Note that posts from new
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 March 2013 14:42:38 UTC-4, larry
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
:description
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 interested in any
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 jimpil1...@gmail.com
mailto:jimpil1...@gmail.com wrote:
how come your project depends on the problematic version 1.5.0?
1.5.0 is problematic
, 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 because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure
) and the method that takes 2 arrays as args
does exist both in the interface and the concrete implementation
(POSTagger POSTaggerME 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
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 this group, send email to clojure
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 the Google
Groups Clojure
))
(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.
To post to this group, send email to clojure
...
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/main/java/opennlp/tools/postag
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 Powell wrote
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
clojure.data.xml/parse, and would
(+ 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 from new members are moderated - please be patient
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 wrote:
Hello,
I have two lists
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 you have
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, i only
care
))
(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 map (with 2 keys :id :ob) seems a
simpler
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't it true
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 :as]?...
Jim
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), hence my question...
Jim
--
--
You received this message because
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 opinion...
Jim
--
--
You received this message because you
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 to this group, send email to clojure@googlegroups.com
301 - 400 of 1144 matches
Mail list logo