an optional
whitespace rule everywhere, documented here under:
https://github.com/Engelberg/instaparse/blob/master/docs/ExperimentalFeatures.md#auto-whitespace
On Mon, Nov 18, 2013 at 5:47 AM, Jim - FooBar(); jimpil1...@gmail.com
mailto:jimpil1...@gmail.com wrote:
Hi all,
I'm having a small
On 19/11/13 11:29, Colin Yates wrote:
Imagine the sequence represents a distribution between 1 and 5. The
initial sequence might only be [{:key 3 :value 30} {:key 4 :value
40}]. I want it to be [{:key 1 :value nil} {:key 2 :value nil} {:key
3 :value 30} {:key 4 :value 40} {:key 5 :value
On 19/11/13 11:42, Jim - FooBar(); wrote:
On 19/11/13 11:29, Colin Yates wrote:
Imagine the sequence represents a distribution between 1 and 5. The
initial sequence might only be [{:key 3 :value 30} {:key 4 :value
40}]. I want it to be [{:key 1 :value nil} {:key 2 :value nil} {:key
3 :value
On 19/11/13 11:29, Colin Yates wrote:
In Java I would do something like:
// create a convenient look up to avoid nasty N^2 lookups
MapObject, Object keyToValue = new HashMap
for (MapObject, Object kvMap: kvSequence)
keyToValue.put(kvMap.get(key), kvMap.put(value));
ListObject allKeys =
Hi all,
I've been wondering about this lately and I'm not sure which approach to
pick as both give the correct results (in my rudimentary tress-test).
So as I understand it is generally suggested to have pure, testable
functions that oter side-effecting functions rely on. like so for example:
On 20/11/13 19:36, juan.facorro wrote:
The value for all refs whose value you don't actually modify inside a
transaction should be obtained through ensure
http://clojuredocs.org/clojure_core/clojure.core/ensureif you want
to make sure :P their value won't be changed by a different
Hi Stefan,
thanks for your interest. let me explain further...
1. I did start with a design that involved a map (the bank) full of
agents (accounts). Then I switched to a map full of atoms thinking that
I don't really need asynchronous operations. I settled to the single ref
approach because
/13 10:58, Jim - FooBar(); wrote:
Hi Stefan,
thanks for your interest. let me explain further...
1. I did start with a design that involved a map (the bank) full of
agents (accounts). Then I switched to a map full of atoms thinking
that I don't really need asynchronous operations. I settled
On 21/11/13 13:19, John D. Hume wrote:
If you want to demonstrate STM with the deposit-withdraw-transfer
example, you definitely need a ref for each account.
I'd suggest an atom for the account-num-balance-ref map (the bank)
and an atom for the account-num-generator, but you say
-num-balance-ref map (the bank)
and an atom for the account-num-generator, but you say coordination
is necessary for opening and closing accounts. What coordination do
you have in mind?
On Nov 21, 2013 5:27 AM, Jim - FooBar(); jimpil1...@gmail.com
mailto:jimpil1...@gmail.com wrote:
also I
is
necessary for opening and closing accounts. What coordination do you
have in mind?
On Nov 21, 2013 5:27 AM, Jim - FooBar(); jimpil1...@gmail.com
mailto:jimpil1...@gmail.com wrote:
also I forgot to add that having the bank in some reference type
allows opening/closing new accounts
On 22/11/13 08:18, Stefan Kamphausen wrote:
How about
(defn get-key-generator []
(let [i (atom 0)]
(fn [] (swap! i inc
(def generate-keys (get-key-generator))
nice one, much better than mine :)
thanks Stefan...
Jim
--
--
You received this message because you are subscribed to
On 23/11/13 14:17, Justin Smith wrote:
you may want to make that (defonce generate-keys (get-key-generator))
and even better, add a start argument to get-key-generator so you
can persist across restarts of the vm.
Of course in a real app the key should be serialized to a persistent,
Hi all,
Technically speaking this is not a question specific to Clojure. I 'd
like to see how people are generally accessing some big resource (e.g a
massive .csv file). My use case is this:
I've got code that fetches the weather conditions from Yahoo, given a
WOE_ID code. The problem is
Hi all,
A very popular interview question is to try implement all arithemtic
operations for integers without using all the usual suspects. After
thinking for a while I concluded that I only really need inc/dec in
order to implement everything else. And the good news is that one can
easily
as an aside, if you're writing def-like macros, I'd encourage you to
look at 'clojure.tools.macro/name-with-attributes'
Jim
On 18/12/13 12:14, Tassilo Horn wrote:
Xiangtao Zhou tao...@gmail.com writes:
Hi!
I want to use reify in macro, but the namespace is the problem. the
following code
Hi all,
is there any way to get rid of reflection in simmilar looking? Nothing
seems to work...
(proxy [JPanel ActionListener KeyListener] []
(paintComponent [^java.awt.Graphics g]
(let [^JPanel this this]
(proxy-super paintComponent g))
thanks in advance... :)
Jim
--
--
Thanks Colin, I did vote for it but its title implies something
different...something restoring original binding on exception...
Jim
On 25/12/13 04:06, Colin Fleming wrote:
That is indeed the same issue, and it even includes a patch with a
test! I've voted for this one, please consider doing
The namespaces you mentioned have already been loaded and thus you can
use the fully qualified name . What if you try
(clojure.inspector/inspect [1 2 3]) in a bare repl???
ClassNotFoundException clojure.inspector java.net.URLClassLoader$1.run
(URLClassLoader.java:366)
I hope that clarifies
Generally speaking, you wouldn't care what has been loaded and what
hasn't and you certainly should not rely on something having been
implicitly loaded.
The current best practice is to use :require in conjunction with :refer
or :as, in all your ns declarations, thus avoiding the need for fully
On 08/01/14 14:38, John Gabriele wrote:
For a tiny Clojure uberjar, startup time on my desktop is about a
second. Tolerable.
well, a tiny Clojure/Swing uberjar on the raspberry-pi (oracle-java7)
takes 9-12 seconds to start!!! not so tolerable...
in fact, in the absence of a splash screen, the
compiled and copied to the device, but
still, not exactly the ideal solution.
Timothy
On Wed, Jan 8, 2014 at 8:43 AM, Jim - FooBar(); jimpil1...@gmail.com
mailto:jimpil1...@gmail.com wrote:
On 08/01/14 14:38, John Gabriele wrote:
For a tiny Clojure uberjar, startup time on my
, but still, not exactly
the ideal solution.
Timothy
On Wed, Jan 8, 2014 at 8:43 AM, Jim - FooBar(); jimpil1...@gmail.comwrote:
On 08/01/14 14:38, John Gabriele wrote:
For a tiny Clojure uberjar, startup time on my desktop is about a second.
Tolerable.
well, a tiny Clojure/Swing uberjar
://www.oracle.com/technetwork/java/embedded/downloads/javase/index.html ?
On Wed, Jan 08, 2014 at 04:36:02PM +, Jim - FooBar(); wrote:
I would recommend the newly available through official Pi channels,
oracle-java7-jdk...It is a full distribution of JIT'ed Java
(including Swing) with hardware-floating
indeed :)
On 08/01/14 17:32, Max Gonzih wrote:
Well it's actually cool that this is inside Raspbian channels.
--
--
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
that is obviously because you still use the Var `xml` somewhere...change
it to a function call`(xml)` and try again :)
Jim
On 09/01/14 11:38, Peter Ullah wrote:
I now get Don't know how to create ISeq from: xml_example.core$xml
clojure.lang.RT.seqFrom (RT.java:505)
--
--
You received this
oops, ny bad it seems you figured it out :)
Jim
On 09/01/14 11:42, Peter Ullah wrote:
My bad, was passing a reference to the function, rather than the
response from the function Doh!
On Thursday, January 9, 2014 11:38:44 AM UTC, Peter Ullah wrote:
I now get Don't know how to create
I quickly put together this which seems to preserver the orderof the
original seq:
(defn uniquify [coll]
(let [post-fn #(group-by first (- % meta :encountered))]
(loop [unique (with-meta [] {:encountered []})
[f more] coll]
(if (nil? f) (flatten (concat unique (reduce #(conj %
actually `post-fn` should be #(group-by identity (- % meta :encountered))
Jim
On 10/01/14 15:28, Jim - FooBar(); wrote:
I quickly put together this which seems to preserver the orderof the
original seq:
(defn uniquify [coll]
(let [post-fn #(group-by first (- % meta :encountered))]
(loop
oops! my fn will not keep the original ordering...sorry Colin
Jim
On 10/01/14 15:34, Jim - FooBar(); wrote:
actually `post-fn` should be #(group-by identity (- % meta :encountered))
Jim
On 10/01/14 15:28, Jim - FooBar(); wrote:
I quickly put together this which seems to preserver
In order to do that you would have to reach to the interface behind the
protocol...observer this:
user= (defprotocol P (f1 [_] nil))
P
user= P
{:on-interface user.P, :on user.P, :sigs {:f1 {:doc YES!, :arglists
([_]), :name f1}}, :var #'user/P, :method-map {:f1 :f1},
:method-builders
On 12/01/14 13:04, bob wrote:
Exactly! the compiler throws the reflection warnings, I want to type
hint for the input parameters to eliminate the warnings.
you must be doing something wrong as a pure protocol based
implementation that doesn't involve interop, shouldn't exhibit
On 12/01/14 13:07, Jim - FooBar(); wrote:
On 12/01/14 13:04, bob wrote:
Exactly! the compiler throws the reflection warnings, I want to type
hint for the input parameters to eliminate the warnings.
you must be doing something wrong as a pure protocol based
implementation that doesn't
Haha I knew it
Instead of using .ret-value and .write use cqrs.storage/ret-value and
cqrs.storage/write...Also in your ns declaration you don't really need
to bring in the protocol. YOu can bring in the functions it defines :)
Jim
On 12/01/14 13:22, bob wrote:
Sure, here has a
many protocols is to put them all in a single file and
:refer :all it.
hope that helps,
Jim
On 12/01/14 13:27, Jim - FooBar(); wrote:
Haha I knew it
Instead of using .ret-value and .write use cqrs.storage/ret-value and
cqrs.storage/write...Also in your ns declaration you don't really need
It is not compiling because it cannot find the function...either fully
qualify it like in my previous email or change your ns declaration to
something like:
[cqrs.storage :as stora]
and then simply use stora/ret-value, stora/write, stora/write-batch
Jim
On 12/01/14 13:26, bob wrote:
If I
On 12/01/14 13:38, Jim - FooBar(); wrote:
It is not compiling because it cannot find the function...either fully
qualify it like in my previous email or change your ns declaration to
something like:
[cqrs.storage :as stora]
and then simply use stora/ret-value, stora/write, stora/write-batch
oops (set! *clojure.core*/*warn-on-reflection* true) instead of
(set! *user*/*warn-on-reflection* true)
On 12/01/14 13:52, Jim - FooBar(); wrote:
there you go:
(defprotocol IBark
(bark [this]))
(in-ns 'other)
(set! user/*warn-on-reflection* true)
(clojure.core/defrecord Dog []
user
On 12/01/14 13:57, bob wrote:
Thanks for the big help, I treated the protocol as interface. :)
no worries :)
I was also surprised to see that you are type-hinting the
clojure.lang.Atom...why would you do that? from what I can see you are
only using `reset!` and `swap!`...I doubt that you are
On 12/01/14 13:59, Jim - FooBar(); wrote:
On 12/01/14 13:57, bob wrote:
Thanks for the big help, I treated the protocol as interface. :)
no worries :)
I was also surprised to see that you are type-hinting the
clojure.lang.Atom...why would you do that? from what I can see you are
only using
On 12/01/14 14:15, Jim - FooBar(); wrote:
(map [this f]
(let [^DBIterator iterator (.iterator db)]
(.seekToFirst iterator)
(clojure.core/map #(apply f %) (iterator-seq iterator
or even nicer:
(map [this f]
(let [^DBIterator iterator (doto (.iterator db) .seekToFirst)]
(clojure.core
an atom cannot be used as a function! deref it first to get the vector
inside and then try again...
Jim
On 14/01/14 11:25, Andreas Olsson wrote:
Cant get this to work.
(def sx2(atom [2 3 4]))
(println (sx2 3))
Den tisdagen den 14:e januari 2014 kl. 12:04:27 UTC+1 skrev Omer Iqbal:
You could do something like this:
(def v {:a--id 1 :a--name A :b--id 2 :b--name B})
(group-by #(- % first str second str keyword) v)
={:b [[:b--name B] [:b--id 2]], :a [[:a--id 1] [:a--name A]]}
(reduce-kv #(assoc % %2 (into {} %3)) {} *1)
= {:a {:a--id 1, :a--name A}, :b {:b--name B,
On 21/01/14 13:11, Chris Perkins wrote:
This part: (some #{hashed} already-seen) is doing a linear lookup in
`already-seen`. Try (contains? already-seen hashed) instead.
+1 to that as it will become faster...
I would also add the following not so related to performance:
(drop1 (line-seqf))
On 22/01/14 13:21, Christophe Grand wrote:
#_ nests nicely:
#_#_ comments out the next two expressions.
Christophe
WHAT?!!! I had no idea.I guess you do learn something new every day :)
Jim
--
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To
Use `==` instead:
user= (== 42 42.0)
true
user= (== 42 42M)
true
Jim
On 27/01/14 13:41, Dennis Haupt wrote:
one does not simply compare floating point numbers for equality
2014-01-27 Eric Le Goff eleg...@gmail.com mailto:eleg...@gmail.com
Newbie question :
user= (= 42 42)
Hi all,
I think we are all familiar with the wonderful core.logic implementation
of a sudoku solver by David Nolen. Now, I am trying to combine his
solver with the `random-puzzle` generator shown here (
http://jkkramer.com/sudoku.html). I have made the necessary changes (to
deal with seqs
On 31/01/14 00:47, Norman Richards wrote:
I don't know how many solutions there are, but it seems like there are
a lot... I think you are just generating all of them and it's taking
a long time.
spot on!!! I was just being stupid (again)...tried with `first` and
worked immediately :)
A predicate is something that returns true or false. Nothing more
nothing less...you can have as many args as you want - it is still a
function predicate :)
Jim
On 31/01/14 16:44, Ryan wrote:
Hello,
I am wondering if all my predicates should be one argument functions
because I run into a
I suggest you check this out:
https://github.com/jimpil/MultiSnake/blob/master/src/multi_snake/core.clj
It is within the LOC you asked and shows a complete snake-game. It has
been adopted and extended from the book Programming Clojure, to handle
2 snakes and some other stuff like dying when
a vector is a function of its indices
a map is a function of its keys
a set is a function of its elements
does this help at all?
Jim
On 03/02/14 15:29, action wrote:
(defn index-filter [pred coll]
(when pred
(for [[idx elt] (indexed coll) :when (pred elt)] idx)))
(index-filter #{\a
Hi all,
I often see this code for summing up a range from 0-N : `(reduce +
(range N))`
However there is a much faster way for this : `(/ (* N (dec N)) 2)`
Do you think this should be in the language so that people do not use
the slow version?
Jim
--
You received this message because
On 10/02/14 15:08, macdevign mac wrote:
(defn testing
(^String [])
(.toUpperCase hello world))
;;syntax for overloading
(defn testing
(^String [] ;;notice the omitted bracket
(.toUpperCase hello world))
(^String [^String a]
(.toUpperCase a)) )
;;non-overloaded fns
(defn
If `session` returns a list, why don't you just do `(take 5 (repeatedly
session))` ???
with regards to concurrency I am not sure what you're asking...you want
to do the same thing from multiple threads and accumulate a global result?
Jim
On 10/02/14 18:46, Haim Ashkenazi wrote:
Hi
I have a
How about the JavaMail API? here is an example :
(defn- map-properties
Converts a MapString, String to a java.util.Properties object.
[^java.util.Map property-value-map]
{:pre [(every? #(every? string? %) property-value-map)]}
(doto (java.util.Properties.)
(.putAll property-value-map)))
Clojure works on a chunked basis for performance reasons...THe size of a
chunk is 32 elements - thus you would actually get 32 printouts if you
supplied a collection larger than 31 elements.
Jim
On 28/02/14 17:04, Andy Smith wrote:
Hi,
Can someone correct my misunderstanding here. I was
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.
:
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(); jimpil1...@gmail.com
mailto:jimpil1...@gmail.com wrote:
I feel obliged to come in and say that using this flag did not
cure my problem completely...This error
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
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
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 'apply
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
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
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
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
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
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...
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 under
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
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
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
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
Hi everyone,
I cannot figure out for the life of me how to pass in an optional
doc-string into a 'defsomething' macro and have it to work. If I
hard-code it then it works just fine...
(defmacro def-plus-doc [name syms]
`(def ~(with-meta name (assoc (meta name) :doc HI!)) ~@syms))
;;this
inside the ` but failed
On Sun, Feb 24, 2013 at 6:02 PM, Jim - FooBar(); jimpil1...@gmail.com
mailto:jimpil1...@gmail.com wrote:
Hi everyone,
I cannot figure out for the life of me how to pass in an optional
doc-string into a 'defsomething' macro and have it to work. If I
hard-code
(NO_SOURCE_FILE:3)
On Sun, Feb 24, 2013 at 7:49 PM, Jim - FooBar(); jimpil1...@gmail.com
mailto:jimpil1...@gmail.com wrote:
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
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 to clojure@googlegroups.com
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
I found this code snippet [1] written by Rich but presumably using a
very old version of Clojure. The thing that stand out the most is this
at the bottom (the 'correct' fn):
(or (known [word] *nwords*) (known (edits1 word) *nwords*)
(known-edits2 word *nwords*) [word])
It
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 cost
I'm not sure I fully understand the problem but I'll do my best to guess...
1) are you sure you're using the protocol or are you actually trying to
define a method in the interface that the protocol generates? Try fully
qualifying the name of you protocol at the extension point...
2)Do your
I just walked in home, sat on my pc, /git-pull/ (what I pushed 30 min
ago), /lein2 repl/, /load-file xxx.clj/ , *BOOM!*
CompilerException java.lang.VerifyError: (class:
hotel_nlp/concretions/models/Workflow, method: run signature:
()Ljava/lang/Object;) Unable to pop operand off an empty
No I did not try Oracle Java6 and it would be a real hassle since it's
not even installed...I think I've got openJDK 6 though...hmm I'll poke
around with the dependencies of the namespace I'm trying to load see if
that changes anything and if it doesn't I'll give openJDK a spin...
Clojure
On 28/02/13 17:29, David Nolen wrote:
Your run protocol defines three arities, you do not implement all three.
what's wrong with that? protocols, unlike interfaces let you do that...
Did you try limiting the definition of the run protocol to the two
arity case that you are actually
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(); jimpil1...@gmail.com
mailto:jimpil1...@gmail.com wrote:
On 28/02/13 17:29, David Nolen wrote
On 28/02/13 18:16, Softaddicts wrote:
We AOT all our code here and even that prove hard
to stabilize with multiple arities.
doesn't /lein2 check/ do AOT? how else would it be able to emit
reflection warnings? If that is the case, I always AOT my code
periodically too.
In this particualr case
Hi all,
Since yesterday, I've been thinking about something David Nolen said in
my /what on earth is happening?/ post. In a nutshell, he suggested
that protocols *should* be fully populated. Luc from softaddicts agreed
and actually shared his own horrific experiences with non-fully
populated
but multiple arities correspond to different method signatures on the
interface level and in fact the protocol level as well...when you
implement either you really treat them as separate fns/methods...how
does the one complect (not implementing some arity) and the other
doesn't (not
On 01/03/13 15:15, Meikel Brandmeyer (kotarak) wrote:
However for some reason I seldomly have the desire to use multiple
arities in protocol functions.
this is the case for me too but only when I'm working in an all-Clojure
project...when doing interop though and especially when I need to
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
On 01/03/13 16:17, Joachim De Beule wrote:
I'm not sure what you mean. I am not changing between namespaces in
this last example, only trying to delete a slot from a record
definition and create a record according to the new definition
subsequently. The problem occurs even when I do a C-c C-k
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 currently playing clojure
(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722
2013/3/5 Jim - FooBar(); jimpil1...@gmail.com
mailto:jimpil1...@gmail.com
I don't know if you can suppress it, but you can certainly ignore
)]
(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*(stdout),
but not *err*(stderr
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
StringWriter
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
Hi all,
I am intrigued about the idea of communicating with my application
remotely...The book 'Clojure Programming' says that nrepl comes with a
consumer lib and is easily embeddable to your apps. Can anyone point me
to a direction where I can find more? perhaps someone ha already done
that
the *err* writer, but instead use the
System/err stream will not get affected.
Hope this makes sense.
2013/3/5 Jim - FooBar(); jimpil1...@gmail.com
mailto:jimpil1...@gmail.com
On 05/03/13 14:50, bruce li wrote:
What is the difference between *err* and System/err?!
its the same
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.2,' project.clj p
mv -f p
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, Jim
On 05/03/13 15:22, Weber, Martin S wrote:
$ lein run -m replbuiltin.core
$ lein repl :connect 42042
user= (in-ns 'replbuiltin.core)
replbuiltin.core= (foo 42)
42
trying to use 'telnet localhost' instead of 'lein repl :connect' cos I
may not have lein access, and it doesn't work! I don't get
1 - 100 of 698 matches
Mail list logo