Thanks to both Atkaaz & Tim...
you were both very helpful, albeit for different reasons! Atkaaz pointed
me to a promising syntax-quoting library that I didn't even know existed
and Tim essentially provided the solution I settled for. Since that
code-snippet can be found in core, I'll just assum
I seem to be unable to quote a form and then repeatedly pass it inside
the extend-protocol macro...something like this:
(def ^:private co-stub
'(run [this ^String text]
(let [ann (edu.stanford.nlp.pipeline.Annotation. text)]
(.annotate this ann) ann)))
(extend-protocol IComponent
edu.s
Hi everyone,
I'm facing a little problem when extending protocols in a mix of
inheriting and implementing classes...Let me explain:
stanford-corenlp defines a top level interface called "Annotator" (with
a single 'annotatate' method signature'). It also defines a class called
"AnnotationPipe
I think Alex is trying to say that a macro is almost never appropriate
when a first-class function would do...therefore, there is no good
reason for carrying the complexity of macros all over your code, given
that in your case they do nothing special (like postponed evaluation)
and can be repla
Even though what Aaron said is correct, I'll just add that with lein2
you can get away with not "installing" your jar in ~/.m2/. Just use the
:resource-paths key in your project.clj and point to a folder with
'orphan' jars...something like this:
:resource-paths ["orphan-jars/*"] ;;all jars un
"clojure-doc.org" ??
OMG, is this new? it seems to have some gorgeous tutorials for
newcomers...LIke Bizics, i had no idea this site existed! How come
google is not showing this in the first page when typing "Clojure docs"
or something like that? I'm definately bookmarking this...
Hi Juan,
I have to admit you're a life saver! You didn't say anything that I did
not know but you did make a couple of observations that made me have a
closer look on my code...For example you noticed that the protocol
extension to String was never registered...That is the *real* problem
here
let me explain with an example:
;;in some namespace x
(defprotocol IStemmable
(stem [this token] [this token lang])
(getRoot [this token dictionary]))
(defprotocol IDistance
(getDistance [this s1 s2] [this s1 s2 m-weight]))
;;in some namespace y that refers all vars from x
(extend-type Strin
Hi Mike,
thanks for your reply...I've actually been keeping a very close eye on
core.matrix since day 1 and I have to admit I am very very tempted to
start contributing...My research is on Text-mining which as you probably
know is machine-learning on text (mainly sequence-labelling, HMM based
Ok, I think I cracked it but as usual someone else might come up with a
cleaner approach...:-)
(defn matrix [dim & dim-lengths]
{:pre [(not (nil? dim))]} ;;cannot accept
(let [bindings (map #(vector (gensym) `(range ~%)) dim-lengths)
symbols (mapv first bindings)
counts (inc (coun
apply does exactly what you're describing...it treats a collection as
several arguments:
(apply + [1 2 3 4]) is equivalent to: (+ 1 2 3 4)
=> 10
so (pmap + '(1 2 3) '(4 5 6) '(7 8 9) ) is equivalent to: (apply pmap +
['(1 2 3) '(4 5 6) '(7 8 9)])
no need for macros and stuff...actually apply
aaa you want a scalar as the result? then use an outer reduce as well:
(reduce +
(pmap #(reduce + %) (partition-all 5 (range 1 20
=>190
Jim
On 02/02/13 13:10, Jim - FooBar(); wrote:
Use this:
(pmap #(reduce + %) (partition-all 5 (range 1 20)))
OR as you yourself said you can use
Use this:
(pmap #(reduce + %) (partition-all 5 (range 1 20)))
OR as you yourself said you can use 'apply' instead of reduce
Jim
On 02/02/13 12:31, Leandro Moreira wrote:
Hi there,
I have this:
*user=>* (partition-all 5 (range 1 20))
((1 2 3 4 5) (6 7 8 9 10) (11 12 13 14 15) (16 17 18 19)
On 28/01/13 18:58, larry google groups wrote:
Interesting. My app leans heavily on (reduce). I think in some places
I might call reduce from inside of another reduce. This is the problem
then?
No no I don't mean plain old 'reduce' but the new 'reducers' library in
1.5...
Jim
--
--
You re
n 28/01/13 18:29, AtKaaZ wrote:
Hi Jim, did you try a 32bit jvm? I wonder if it still happens with that
On Mon, Jan 28, 2013 at 7:28 PM, Jim - FooBar(); <mailto:jimpil1...@gmail.com>> wrote:
I feel obliged to come in and say that using this flag did not
cure my problem completel
I feel obliged to come in and say that using this flag did not cure my
problem completely...This error is still thrown whenever i use ^:const
and reducers to traverse tree of moves deeper than 6...It doesn't happen
always but most of the times! If i don't use ^:const it seems to not
happen. Not
ll the way, skipping reset! completely:
(swap! game-objects (fn [objects] (reduce-kv #(assoc % %2
(update-object
%3)) {} objects) ))
Jim
ps: I've not tested this but i don't see why this approach
wouldn't work...
On 21/01/13 20:24, Jim - FooBar(); wrote:
...or you can go all the way, skipping reset! completely:
(swap! game-objects (fn [objects] (reduce-kv #(assoc % %2 (update-object
%3)) {} objects) ))
Jim
ps: I've not tested this but i don't see why this approach wouldn't work...
On 21/01/13 20:24, Jim - FooBar(); wrote:
u
use reduce-kv on the original map to save some intermediate vector
allocation...something similar has come up recently...
(reduce-kv #(assoc % %2 (update-object %3)) {} @game-objects)
Jim
On 21/01/13 20:21, JvJ wrote:
I'm updating a set of objects stored in a map, and I feel like the way
I'm
ka -XX:-UseCompressedOops (note the
minus) or the enabled(as is the default) compressed oops aka
-XX:+UseCompressedOops
Does it happen even if you use eval ?
On Mon, Jan 21, 2013 at 7:19 PM, Jim - FooBar(); <mailto:jimpil1...@gmail.com>> wrote:
our happiness was short-lived...I st
but the returned class
seems to be the same that PersistenVector - anyway I'm just guessing
around, doesn't help :)
On Mon, Jan 21, 2013 at 6:17 PM, Jim - FooBar(); <mailto:jimpil1...@gmail.com>> wrote:
On 21/01/13 17:07, Jim - FooBar(); wrote:
On 21/01
On 21/01/13 17:07, Jim - FooBar(); wrote:
On 21/01/13 16:47, AtKaaZ wrote:
Could you retry using this
-XX:-UseCompressedOops
surprisingly this worked! I don't get that error anymore... I used to
have it but i thought it was completely unnecessary...I don't
understand how this a
On 21/01/13 16:47, AtKaaZ wrote:
Could you retry using this
-XX:-UseCompressedOops
surprisingly this worked! I don't get that error anymore... I used to
have it but i thought it was completely unnecessary...I don't understand
how this affects the runtime of my program!
Jim
--
You received
On 21/01/13 01:24, AtKaaZ wrote:
yes, your code works if you don't use the "^:const", but why doesn't
it work with ^:const when you just use the return of mapv (something
with reify?)?
Well, I just came home and tried a couple of things out...It appears
that my code *doesn't* work if I don't
tln xam0)
(let [ xam (translate 1 2 mappings-8x8) ]);this one throws:
can't embed even before Wrong number of args (3)
///end ignore
Maybe someone can explain...
This was enjoyable ;)
On Mon, Jan 21, 2013 at 12:03 AM, Jim - FooBar();
master/src/Clondie24/games/chess.clj#L238
On Sun, Jan 20, 2013 at 7:58 PM, Jim - FooBar(); <mailto:jimpil1...@gmail.com>> wrote:
Hi everyone,
I came back to a project of mine after a couple of months only to
be surprised by some cryptic exception! Imagine a 2d vector:
(d
n 20, 2013 at 2:03 PM, Jim - FooBar(); <mailto:jimpil1...@gmail.com>> wrote:
I've recently noticed this:
http://dev.clojure.org/jira/browse/CLJS-453
It is for cljs but it makes sense right?
We do have them for maps - how hard can it be to make them for
small vect
I've recently noticed this: http://dev.clojure.org/jira/browse/CLJS-453
It is for cljs but it makes sense right?
We do have them for maps - how hard can it be to make them for small
vectors as well? In fact I'm surprised we don't have them already but
perhaps I'm missing crucial details... dest
Hi everyone,
I came back to a project of mine after a couple of months only to be
surprised by some cryptic exception! Imagine a 2d vector:
(def coords [[0 0] [0 1] [1 0] [1 1]]) ;;vector of vectors of longs
;;but let's try ints which are cached:
(def coords
(mapv #(apply vector-of :int %
On 16/01/13 18:57, Aaron Cohen wrote:
My first guess would be *ns* is different when you try it at the repl.
Thanks a million Aaron...That was very helpful. I can't believe I wasted
2 more than 2 hours for something like this!
Jim
--
You received this message because you are subscribed to t
Hi everyone,
Does anyone have a clue why this would perfectly run on the repl but
will throw NPE when run from the jar or via lein2 run (aot-ed)?
;;there exist global vars of the form 'xxx-NER-tags'
;;first the repl everything works as expected...I get the map back
PAnnotator.core=> (var-ge
On 14/01/13 22:15, Marko Topolnik wrote:
But... you were quite clear in stating that your function isn't lazy,
and you were right to say that: /doall/ will not return until
*all* the tasks have completed. Maybe you did want laziness, after all?
I'm not entirely sure what you mean here...The on
wow! this looks very useful...
thanks Alan - knowledgeable as always! :-)
Jim
On 14/01/13 19:41, Alan Malloy wrote:
(clojure.tools.macro/symbol-macrolet [P +, M -, T *]
...)
The tools.macro code-walker is much smarter and more careful than any
that you or I will ever write.
On Monday, Jan
On 14/01/13 21:27, Jim - FooBar(); wrote:
On 14/01/13 20:47, Marko Topolnik wrote:
What exactly is the value provided by ExecutorCompletionService? To
my eyes, this function is quite similar to (comp doall pmap), but
with shuffled result. There is no advantage to using the lazy
approach to
On 14/01/13 20:47, Marko Topolnik wrote:
What exactly is the value provided by ExecutorCompletionService? To my
eyes, this function is quite similar to (comp doall pmap), but with
shuffled result. There is no advantage to using the lazy approach to
submitting tasks: you could have simply used i
First of al let me say that pmap is NOT useless at all...I've
encountered cases where I've had to accumulate a collection of 'pmap'-ed
elements (say Strings) before the final task (say 'spit'-ing them) where
having laziness is a big win in terms of memory footprint...On the other
hand there are
hehehe...I'm really stupid aren't I?:-[
thanks Stuart...
Jim
On 09/01/13 21:11, Stuart Sierra wrote:
You could also do:
(defrecord MString [string])
-S
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@g
On 09/01/13 18:20, Jim - FooBar(); wrote:
Alex's solution is also quite idiomatic and it takes care of the
transient/peristent conversion as well...It seems slightly heavier
though cos you're building an intermediate vector.
CORRECTION: you'd be building MANY intermediate ve
)) old-map))
;;% is the initial value %2 is the key of the old-map & %3 is the value
of the old-map
Alex's solution is also quite idiomatic and it takes care of the
transient/peristent conversion as well...It seems slightly heavier
though cos you're building an intermediate vector.
Jim
you can use reduce-kv...This is exactly its purpose - to be able to
reduce maps without the need of destructuring
example:
(reduce-kv some-fn-with-3-args {} old-map)
Jim
On 09/01/13 18:09, Jonathon McKitrick wrote:
I have a map derived from JSON data where the keys are strings. I
want to bu
Hi everyone,
Since i was reading about queues these days i decided to write a couple
of functions that would include the basic queue functionality that I
might need when working with queues in Clojure. They are pretty basic
and I've not thoroughly tested them but they seem to behave well...I'm
od certain
things...back to reading! :-)
[1] http://briancarper.net/blog/449/
Jim
On 04/01/13 19:20, Jim - FooBar(); wrote:
Greetings and all best wishes for 2013 to everyone!!! :-)
First of all, forgive me for hijacking this thread but I what I
started to do originated from this thread and so I
Greetings and all best wishes for 2013 to everyone!!! :-)
First of all, forgive me for hijacking this thread but I what I started
to do originated from this thread and so I feel it is related.
So, for the fun (and the learning) of it, I thought to create a queue
literal myself as suggested in
r with the "." came from the fact Component is a compiled
class and I believed I had to follow the Java standard writing.
Thank for your help.
On 12/24/2012 01:42 PM, Jim - FooBar(); wrote:
Lose the "." - call children? like this: (children? c) and make sure
you can see the t
Lose the "." - call children? like this: (children? c) and make sure you
can see the test-record.component namespace from your user ns (apart
from importing the record class).
HTH,
Jim
On 24/12/12 11:55, Christian Sperandio wrote:
Hi,
I'm testing the use of records in Clojure and I have som
On 18/12/12 18:46, Vladimir Matveev wrote:
Well, it is news for me since it is not documented anywhere. Why is
this so?
it is at least mentioned here in an example...look at line 6
http://clojuredocs.org/clojure_core/clojure.core/definterface
Jim
--
You received this message because you ar
Java methods are not first-class...you cannot use them like that...you
need an object to call the method on...by wrapping the java call with an
anonymous fn you are able to use Math/sqrt as 1st-class...
Hope it is clearer now...
Jim
On 16/12/12 19:33, Larry Travis wrote:
It almost certainly h
r
foo=> (ns user) ;;back to user ns (doesn't depend on foo)
nil
user=> ((record-factory "foo.Bar") 1 2)
#foo.Bar{:x 1, :y 2}
user=> (Bar. 1 2)
CompilerException java.lang.IllegalArgumentException: Unable to resolve
classname: Bar, compiling:(NO_SOURCE_PATH:1)
Jim
On 12/12/12
I know my reply is a bit delayed but the past 2-3 days have been frantic!
On 12/12/12 18:00, Michał Marczyk wrote:
@Jim:
That function generates factory functions which themselves use no
reflection and incur no performance penalty at all. The only
performance hit visible at runtime comes from t
On 12/12/12 17:37, Mark Engelberg wrote:
Yes and no. That's basically what I'm trying to do, but I only have a
handful of concrete implementations to choose from, so I don't mind
writing a hard-coded cond that chooses between them based on some sort
of keyword that the user passes in. So the
Rich explains why here:
https://groups.google.com/forum/?fromgroups=#!msg/clojure/-gCg_0wmT5o/H7WobsV-yt0J
Jim
On 09/12/12 15:06, Yinka Erinle wrote:
Thanks Jim.
I wonder why.
On Sunday, December 9, 2012 2:43:54 PM UTC, Jim foo.bar wrote:
Unfortunately you have to import each class separ
Unfortunately you have to import each class separately...no wild-cards
in ns declarations :-(
Jim
On 09/12/12 14:21, Yinka Erinle wrote:
Hi,
Is it possible to import multiple java classes using import?
e.g (import '(java.naming.*))
Or will I have to import each class separately?
Thanks,
Yin
Use java 7 with clojure 1.5.0-beta1 or use java6 with the jsr166.jar
already in your classpath...Alternatively, if you use some clojure
version older than 1.5.0-beta1 with Java 7 you may need to build clojure
on your system...
Hope that helps...
Jim
On 09/12/12 12:44, Alex Baranosky wrote:
Hi Lee,
Would it be difficult to try the following version of 'pmap'? It doesn't
use futures but executors instead so at least this could help narrow the
problem down... If the problem is due to the high number of futures
spawned by pmap then this should fix it...
(defn- with-thread-pool* [
Even though this is very surprising (and sad) to hear, I'm afraid I've
got different experiences... My reducer-based parallel minimax is about
3x faster than the serial one, on my 4-core AMD phenom II and a tiny bit
faster on my girlfriend's intel i5 (2 physical cores + 2 virtual). I'm
suspecti
Its perfectly fine to use some as a predicate as far as I know...works
excellent with if-let/when-let - what is the problem?
Jim
On 02/12/12 19:47, Tom Hall wrote:
Hi Guys,
We seem to have not-any? but not an any? function,
I know we have some but it is not a predicate and I found myself
def
Hi all,
For the past 2 hours I've been trying to write 'afilter' or 'aremove'
on top of 'areduce' but I'm totally failing...something goes wrong with
the type hints I suspect...I started with the simplest case possible:
(defn aremove [pred ^longs ns]
(areduce ns i ret (long-array (alen
I'm having the same problem as Chris...
Serialization and deserialization from a REPL works fine whereas from
the GUI it doesn't...ClassNotFoundException...
binding *use-context-classloaders* to false did not help and invoking a
future or an agent from the event handler doesn't work either...Th
On 21/11/12 16:22, Timothy Baldridge wrote:
If you are running pure arithmetic code over primitive arrays, and not
doing allocation (so no seqs, higher order functions, etc.) then it's
pretty straight forward to translate Clojure code to GPU code. Now
notice that all the above qualifications ar
Hi all,
I just came back from a seminar at Manchester University where the
speaker from ARM spent an hour talking about GPUs, OPENCL etc etc. The
thing that is stuck in my head is that, apparently ARM is trying to
create this language (PENCIL) which at the moment is a c-variant but
they are
aaa ok I see...
so I can have my cake and eat it too? :-)
I'm just surprised cos slurp/spit has never failed me before and I've
tried with maps, vectors & lists but everyone is suggesting it is wrong
practice...
anyway, thanks for taking the time...
Jim
On 20/11/12 19:58, Stuart Sierra wro
Until recently I was using the following snippet for writing a map on a
file...basically I was using spit/slurp. Nothing easier
(defn data->string
"Writes the object b on a file f on disk as a string."
[b fname]
(io! (spit fname b)))
(defn string->data
"Read the file f back on memory safely (
On 20/11/12 18:08, Vladimir Tsichevski wrote:
I've started a nREPL process embedded into some Java application. I
can successfully connect to it and execute code remotely from other
Clojure process.
I'd be very interested if you could share some code...I want to do
something similar in one of
On 20/11/12 17:45, Moritz Ulrich wrote:
How often do you need a top-level promise? Where are the advantages over
the def-only example?
if you consider (defn x...) to have an advantage over (def x (fn...)),
then this is the same case...People don't often need top-level promises
but sometimes t
On 19/11/12 19:48, Sean Corfield wrote:
Try -beta1 - I recall a patch recently that was supposed to fix this.
thanks it works! :)
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
Not
Moving from clojure-1.5-alpha1 to -alpha4 i get this again:
NoClassDefFoundError jsr166y/ForkJoinTask clojure.core.reducers/fjinvoke
(reducers.clj:61)
It took me a minute but eventually I remembered the same thing happened
when I moved from 1.4 to 1.5-alpha1 in order to use reducers. There
s
for what its worth, I'm building a highly polymorphic board-game engine
[1] and I've stayed away from multimethods...I've used every single
polymorphism capabillity that clojure provides (records/protocols,
map-based, HOFs etc) except multi-methods. Performance is acritical
matter for this pro
? K.
On 18 November 2012 21:16, Jim - FooBar(); wrote:
I'm struggling to find an explanation for this...
what on earth is this? what does it mean?
Can anyone clarify where this exception comes from?
Jim
--
You received this message because you are subscribed to the Google
Groups "Cl
I'm struggling to find an explanation for this...
what on earth is this? what does it mean?
Can anyone clarify where this exception comes from?
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
On 18/11/12 15:14, Nelson Morris wrote:
enclog 0.5.8 appears in the releases repo, so everything is ok.
No, unfortunately everything is not ok...fetching the jar from a project
results in:
Could not transfer artifact enclog:enclog:pom:0.5.8 from/to clojars
(https://clojars.org/repo/): Check
rase:Forbidden.
Failed to deploy artifacts: Could not transfer artifact
enclog:enclog:pom:0.5.8 from/to clojars (https://clojars.org/repo/):
Access denied to:
https://clojars.org/repo/enclog/enclog/0.5.8/enclog-0.5.8.pom,
ReasonPhrase:Forbidden.
Is this important?
Jim
On 18/11/12 14:46, Jim
artifacts: Could not transfer artifact
enclog:enclog:pom:0.5.8 from/to clojars (https://clojars.org/repo/):
Access denied to:
https://clojars.org/repo/enclog/enclog/0.5.8/enclog-0.5.8.pom,
ReasonPhrase:Forbidden.
Is this important?
Jim
On 18/11/12 14:46, Jim - FooBar(); wrote:
On 18/11/12 14:39
On 18/11/12 14:39, Nelson Morris wrote:
The previous one was a bit
strict on the whitespace
I just pasted the same with no wxtra white-space and now I'm getting
Invalid anti-forgery token
my god what is happening?
Jim
--
You received this message because you are subscribed to the Google
Followed the instructions below exactly but clojars says 'Invalid PGP
public key'...
any clues?
Jim
On 18/11/12 13:56, Phil Hagelberg wrote:
If you don't have a key yet, generate one with `gpg --gen-key`. The
default settings are pretty good, though I'd recommend making it expire
in a year or
The constructs it means are probably reference-types.
Jim
On 18/11/12 13:42, Hank wrote:
According to Wikipedia, Clojure provides "explicit progression-of-time
constructs": http://en.wikipedia.org/wiki/Clojure
Anyone any clue which constructs are meant by that? The term doesn't
even resolve
Oops! I can use :dispose instead of :exit. If it does what it implies,
it should do the job...
Jim
On 15/11/12 23:29, Jim - FooBar(); wrote:
Wow! Unbelievable !
So there is nothing wrong with my code?
After reading this thread, it seems like a serious issue...the entire
repl becomes
oups.google.com/forum/?fromgroups=#!topic/leiningen/QLcZIK2e5C0
I agree, it's annoying, but not sure how to workaround it? Maybe with
a heartbeat between nrepl client/server with the client closing the
repl session if the heartbeat been missing for x seconds...
Hth! K.
On 13 November 2012
all lein2 project on github with what you
previously pasted in this thread correctly spread over files, etc., so
that it's really quick to reproduce the error?
Thanks,
Laurent
Sent from a smartphone, please excuse the brevity/typos.
Le 13 nov. 2012 ą 22:52, "Jim - FooBar();" a éc
On 13/11/12 21:45, Dave Ray wrote:
Dump the JVM's threads [1] and see what it's stuck on?
What am I looking for? I don't see anything related with my project...IT
is pretty obvious from the output though that everything is waiting! No
clue what though...
Jim
On 13/11/12 20:36, Dave Ray wrote:
Just a wild guess, but if something's shown on the screen,
#'draw-tiles will probably get invoked to paint the canvas and it
might end up blocking on the #'curr-game promise.
thanks for your response Dave,
even though I'm not entirely sure what you mean, I can
Hi all,
I've had this unbelievable problem for some time now but I'm sick and
tired of ignoring it! It is literally driving nuts...Due to the nature
of the problem my terminal hangs and Eclipse crashes altogether
(potentially losing work)!
So what is the problem...Well I really don't have a
Kibit is probably looking for syntactic patterns not for types or
anything like that... but still, why is it suggesting this?
Jim
On 11/11/12 15:58, Jim - FooBar(); wrote:
Kibit says:
Consider using:
(vec (:children (game-tree dir b next-level)))
instead of:
(into [] (:children (game
Kibit says:
Consider using:
(vec (:children (game-tree dir b next-level)))
instead of:
(into [] (:children (game-tree dir b next-level)))
why is that?
Does it make a difference if '(:children (game-tree dir b next-level))'
returns a reducer?
Jim
On 11/11/12 15:08, Jonas wrote:
Hi
Tod
Hi all,
looking at core.logic on github I can see no dependencies on the
optimized pattern-matching lib 'core.match', however David implies that
does core.logic uses core.match under the hood in one of his talks [
http://www.infoq.com/presentations/The-Mapping-Dilemma]...
have I misunderstoo
e constant time
operations, but it would not surprise me if in practice transients
aren't universally faster than persistent.
Performance in different environments varies wildly, so I would doubt
results from a small benchmark on a single machine are universally
applicable.
Benchmarking is hard,
No I'm on Ubuntu 12.04 64bit, oracle-java 7, clojure 1.4...
Jim
On 09/11/12 03:36, Herwig Hochleitner wrote:
Hmm, this is the second (unverified) report of transients being slower
than persistents.
Jim, are you on OSX too, by chance? Which JVM?
--
You received this message because you are su
to and from transients should be constant time
operations, but it would not surprise me if in practice transients
aren't universally faster than persistent.
Performance in different environments varies wildly, so I would doubt
results from a small benchmark on a single machine are u
Some quick benchmarking that I did, showed that it is actually more
expensive to convert to transient, conj/assoc and convert back to
persistent than the regular conj/assoc unless you want to do more than 8
operations at a time (preferably more than that). My experiments were on
vectors and the
I'm pretty sure this is still valid
:)
Jim
On 08/11/12 16:57, David McNeil wrote:
I notice the following item at
http://dev.clojure.org/display/design/Library+Coding+Standards
"Be explicit and minimalist about dependencies on other packages.
(Prefer the :only option to use and require)."
This is exactly the approach I'm taking...'doall' retains the head so
with massive files it will break...'doseq' will not. at least this is my
understanding...
Jim
On 07/11/12 19:25, Sean Corfield wrote:
I suspect it's considered more idiomatic to do:
(defn process-records [process file-nam
ay. It seems like the simplest
approach is to just adjust my instincts and always make sure the
sequence is fully consumed within the with-open.
Cheers,
Dave
On Wed, Nov 7, 2012 at 10:56 AM, Jim - FooBar(); wrote:
I know I'm coming a bit late in this thread but i did not have the chance t
I know I'm coming a bit late in this thread but i did not have the
chance to reply earlier...
Can somebody elaborate briefly what is the problem with the combination
of with-open/doseq/line-seq? In a project of mine I'm dealing with files
larger than 200MB (which of course will not even open o
You say that from the safe standpoint of being able to enumerate all
OSes in advance...I can imagine a world where anyone can have his own
OS. :-)
Seriously now, this is not production code obviously! just a demo...
Jim
On 25/10/12 21:04, Brandon Bloom wrote:
|(||fn||[||_ _||]||;dispatch
On 25/10/12 20:57, Jordan Lewis wrote:
Jim, thanks for the suggestion. I am trying to get a feel for how
core.logic works, not reinvent code from the combinatorics library.
Fair enough... :-)
Jim
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To
On 25/10/12 20:33, Laurent PETIT wrote:
Wow, this kind of decision is not for the faint of heart.
Not to be taken lightly, that's for sure! Because then, your code
becomes non pure, harder to test, etc.
not saying that it was not appropriate in your case, but rather than
used as a demonstration
I think you want to have a look at clojure.math.combinatorics
Jim
On 25/10/12 20:10, Jordan Lewis wrote:
Hi,
I'm new to core.logic and logic programming in general. I tried to
write a small program to generate all permutations of any size for an
input list with unique elements. To start, I h
On 25/10/12 19:49, Brian Craft wrote:
heh. I see. Thanks!
No problem...;-)
Jim
ps: It goes without saying that you shouldn't sprinkle your code with
multi-methods just because you can! Trust me, I know they are nice and
very tempting to use but save them for when you truly need
multiple-di
On 25/10/12 19:57, Sean Corfield wrote:
On Thu, Oct 25, 2012 at 11:39 AM, larry google groups
wrote:
How do you know this? Where is this documented? I find myself baffled as to
what is a dependency and what is not.
http://clojure.github.com
If it's listed separated there, it's a contrib you n
On 25/10/12 19:39, larry google groups wrote:
How do you know this? Where is this documented? I find myself baffled
as to what is a dependency and what is not.
OK I'll grant you this...Documentation is not the strong part of
Clojure. There have been/still are efforts to improve on this but
ge
On 25/10/12 19:38, Brian Craft wrote:
Multimethods seem like a convenience layer over duck typing: probe the
object to see what it is, then dispatch. Is that a fair description?
Not exactly...MUlti-methods have no limitations with regarding dispatch.
You can dispatch on anything...I mean ANYTH
301 - 400 of 708 matches
Mail list logo