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
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)))
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
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
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
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
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
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)
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
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))
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,
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:
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
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
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
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
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
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
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
--
--
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,
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
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
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,
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 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
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:
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'm having a small problem composing smaller matches in instaparse. Here
is what I'm trying...just observe the bold bits:
(def parsePK
(insta/parser
S = TOKEN (SPACE TOKEN PUNCT?)* END
TOKEN = (NUM | DRUG | PK | DRUGPK | MECH | SIGN | EFF | ENCLOSED) /
WORD
WORD =
Hi people,
I 'll have to apologise in advance for the potential vagueness of my
question but I am utterly baffled by the behaviour I am seeing and I'd
like to share ask.
I have a (seesaw) GUI with a swingx.busy-label which I want activated
when certain tasks are performed. The code that
mailto:joshnet2...@gmail.com wrote:
Try to create a simple app that just demonstrate the issue. Then
send the sample to the mailing list. Most likely you won't have to
send because you will discover the problem in the process.
Josh
On 14 Nov 2013 23:08, Jim - FooBar(); jimpil1
in the process.
Josh
On 14 Nov 2013 23:08, Jim - FooBar(); jimpil1...@gmail.com
mailto:jimpil1...@gmail.com wrote:
Hi people,
I 'll have to apologise in advance for the potential vagueness
of my question but I am utterly baffled by the behaviour I am
seeing and I'd
you don't need 'fn' when you're using #(...) - that is the whole point.
To not have to declare a function and its args explicitly.
this particular example you cannot write using #() syntax though because
it is recursing at 2 points and you cannot use 'recur'.
Jim
wOn 13/11/13 17:41, Angus
sorry for nitpicking but Richard Stallman has spent some 35 years
explaining/defining what is meant by free. I will not pretend that I
know what all these licences say or even that I spend too much time
deciding what license to use for my own code but at least a
philosophical level, I stand
Hi Ru,
Think of it this way...In Java you can't declare something as public
from within a method. Ok, in Java this would break the object's contract
but even if you look at languages like python, you still don't define
global variables from within functions. I have seen python code where
Hi all,
I was under the impression that I fully understood what
name-with-attributes does but I'm having a slight problem. I'm trying to
define macros like the following:
(defmacro defworkflow
Defines a top-level Workflow with the specified name optionally
doc-string and attr-map on the
On 31/10/13 12:43, P Martin wrote:
To clarify my error, I did not put your suggestion into the ns
declaration. I called it on a separate line of code. I now just have
all of my require statements at the top of my clj files with proper
aliasing and it works fine.
well yes if you do have a
Hi all,
I'm starting to get the hang of instaparse and it just looks awesome!
However there is a little thing that bugs meI may be doing it wrong
that why I'm asking here. The behaviour that I want sounds reasonable at
least to me...so here is an example:
(insta/parser
S = TOKEN
awesome news :)
Jim
On 31/10/13 14:19, Andy Fingerhut wrote:
Just a follow up after a fair amount of thinking and experimentation
has been done on this problem.
Mark Engelberg has a very nice document describing the existing hash
functions used by Clojure, examples with why they can cause
On 31/10/13 16:23, Jim - FooBar(); wrote:
The result of this is a parser which sees everyhting as :TOKEN. That
is because WORD matches almost everything. However I thought that
putting it last would remedy the situation...it seems that the most
general rule is applied first. Is that by design
On 31/10/13 17:21, Lars Nilsson wrote:
Perhaps remove DRUG from the grammar and use the transform function on
a parse-result to do something like
(insta/transform {:WORD (fn [w] (if (...) [:DRUG w] [:WORD w]))} parse-result)
so [:DRUG w] is emitted for whatever criteria you may have (lookup)
On 30/10/13 16:19, Mars0i wrote:
Still, I'm surprised. /Why/ can't I document a record type with a
docstring?
of course you can...just add a :doc key in the record's meta :)
Jim
--
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this
On 30/10/13 16:56, P Martin wrote:
Thanks - I'm still a little confused on the different between use and
require.
'use' is sort of deprecated after it was noticed that people were
abusing it. It's not exactly deprecated because in some cases like
incremental development at the repl it is
On 30/10/13 16:54, Phillip Lord wrote:
Jim - FooBar(); jimpil1...@gmail.com writes:
On 30/10/13 16:19, Mars0i wrote:
Still, I'm surprised. /Why/ can't I document a record type with a docstring?
of course you can...just add a :doc key in the record's meta :)
The OP is correct. He says why
use deftype which is more low-level and I think doesn't define equals or
put y in meta data that don't participate in equality...:)
Jim
On 22/10/13 22:44, Marc Dzaebel wrote:
http://cmayes.wikispaces.com/PracticalClojure13: ...
defrecord does not support Java class inheritance, so it
On 15/10/13 18:02, Sean Corfield wrote:
One construct using let that I see in my code quite a bit that I
haven't figured out a cleaner way to express:
(let [x (some-expression)]
(if (p x)
(f x)
(g x)))
wasn't cond- designed exactly for that?
(let [x (some-expression)]
(cond- x
From the 1.3 docs:
;; Currently Clojure does not permit type hints of arrays, e.g. ^ints as
;; argument types or return types in a definterface. This may be enhanced
;; later.
Jim
ps: also, non-primitive arrays are hinted like this if I'm not mistaken:
#^[Ljava.lang.String;
On 09/10/13
On 09/10/13 14:12, Jim - FooBar(); wrote:
ps: also, non-primitive arrays are hinted like this if I'm not
mistaken: #^[Ljava.lang.String;
actually you can use both #^ ^ in regular 'defn'
Jim
--
--
You received this message because you are subscribed to the Google
Groups Clojure group
Hi all,
does anyone have a clue why light-table 0.5.3 throws exception whenever
it sees a (set! *unchecked-math* true)?
I mean it swallows (set! *warn-on-reflection* true) just fine! Is this a
bug?
the actual exception is
(set! *warn-on-reflection* true)
(set! *unchecked-math* true)
as Armando pointed out unless you remove the stack-issue memoization is
not going become your friend. My take would be to simply use loop/recur
and then you can memoize 'relentlessly', as Rich likes to put it :)
(defn gauss-recurse [n]
(loop [i n acc n]
(if (zero? i) acc
(recur
HI all,
I've gotten myself into a weird situation...
I'm defining a def-like macro and I want to use 'name-with-attributes'.
Consider the following skeleton:
(defmacro defX [name args]
(let [[name attrs] (name-with-attributes name args)]
`(let [cs-coll# ~attrs]
(assert (every?
I ended up using (list ~@attrs) which is very similar to what you're
suggesting...:)
JIm
On 05/09/13 20:22, Dave Ray wrote:
~(vec attrs), perhaps?
On Thu, Sep 5, 2013 at 12:20 PM, Jim - FooBar(); jimpil1...@gmail.com
mailto:jimpil1...@gmail.com wrote:
HI all,
I've gotten myself
I've been staring at this function for 20 minutes now
(name-with-attributes)...I must be totally stupid but even though I 've
understood what it does I can't figure out how to use it. Does anyone
have an example usage? Let's suppose I want to define a DEFN macro that
behaves exactly like
Yes! I eventually figured it out...thanks Konrad :)
Jim
On 03/09/13 20:49, Konrad Hinsen wrote:
--On 3 septembre 2013 19:08:12 +0100 Jim - FooBar();
jimpil1...@gmail.com wrote:
understood what it does I can't figure out how to use it. Does anyone
have an example usage? Let's suppose I want
On 29/08/13 20:23, JvJ wrote:
I wonder if the somewhat counterintuitive concept of a named
anonymous function eludes some people, or isn't properly conveyed in
tutorials.
I only consider #(...) as an anonymous function. The longer form (fn []
(...)) has the potential of being perfectly
On 23/08/13 10:49, Jim wrote:
I do regret not having checked whether Java serialization preserves
the metadata or not .I plan to do it this afternoon. If it does ,I've
got 2 perfectly working ways to achieve what I want, with no extra
dependencies added...
I finally got the chance to check
I had a quick look at clj-tuple and I don't remember seeing any macros...
Jim
On 26/08/13 19:02, Asim Jalis wrote:
I believe this is what clj-tuple is doing under the hood with macros.
On Aug 26, 2013, at 10:38 AM, Kevin Downey redc...@gmail.com wrote:
A Tuple protocol that defines get0
wow! very interesting stuff as always Zach...quick question:
I don't see Tuple implementing clojure.lang.Associative, so 'get' won't
work right?
Jim
ps: I've got a project where I 'm working with a lot of 2-element
vectors...I can't wait to try this out :)
On 25/08/13 03:38, Zach Tellman
all I'm trying to do is to provide a uniform mechanism to save/load
game-states across my 2D board-games. Everything works just fine without
that trick for most games but chess is peculiar (or my implementation is
peculiar if you like) because in order to implement castling/enpassant
moves
?
Jim
On 20/08/13 20:17, Jim - FooBar(); wrote:
Hi all,
I've a rather strange problem...I know that all clojure collections
implement Serializable but when I try to use standard Java
serialization on a vector of records I get this exception:
/NotSerializableException clojure.core.Vec
Hi everyone,
I am trying to serialise a record with edn. I think I am using all the
good practices but I get a weird error...I am using these simple functions:
(defn data-string
Writes the object b on a file f on disk as a string.
[b f]
(io!
(with-open [w (clojure.java.io/writer f)]
Hi all,
I've a rather strange problem...I know that all clojure collections
implement Serializable but when I try to use standard Java serialization
on a vector of records I get this exception:
/NotSerializableException clojure.core.Vec
java.io.ObjectOutputStream.writeObject0
why on earth is this a macro and not a regular fn?
Jim
On 14/08/13 16:19, Daniel Meneses wrote:
Hi!
Thanks for your answer Sean I got it solved using clj-time
Also I found the problem with my macro attempt
user (defmacro is
[s instant]
`(= (.get ~instant
On 14/08/13 16:45, Daniel Meneses Báez wrote:
(defn is [s instant]
(= (.get instant Calendar/DAY_OF_WEEK)
(. Calendar s)))
(def ^:private day-int
{:MONDAY 2 :TUESDAY 3 :WEDNESDAY 4 :THURSDAY 5 :FRIDAY 6 :SATURDAY 7
:SUNDAY 1})
(defn is-today?
([s instant]
(= (.get
On 14/08/13 17:46, Jim - FooBar(); wrote:
On 14/08/13 16:45, Daniel Meneses Báez wrote:
(defn is [s instant]
(= (.get instant Calendar/DAY_OF_WEEK)
(. Calendar s)))
(def ^:private day-int
{:MONDAY 2 :TUESDAY 3 :WEDNESDAY 4 :THURSDAY 5 :FRIDAY 6 :SATURDAY 7
:SUNDAY 1
On 13/08/13 13:47, Jay Fields wrote:
Say you have a simple function: (defn do-work [f] (f))
When you want to call do-work you need a function, let's pretend we
want to use this function: (defn say-hello [n] (println hello n))
Which of the following solutions do you prefer?
(do-work (partial
same here! can we get the 2.3.0.-jar from clojars? does anybody know?
Jim
On 09/08/13 08:14, Phillip Lord wrote:
Also here on linux.
Unfortunately, after upgrading the bash script, so it leaves a broken install.
Phil
From: clojure@googlegroups.com
aa the old 'why contains? doesn't work' discussion...even though
it's been a while since it last came up on this list, it must be the
single most popular questions :)
Jim
On 07/08/13 12:24, Goldritter wrote:
In an program I used the result of keys as an argument for a function
which
the video is not available from that link...
Jim
On 04/08/13 17:25, John Conti wrote:
Hi all,
Justin Reed recently spoke at our local user group on Clojure. One
thing I like about this talk is it addresses many of the concerns and
complaints of programmers who do not want to try Clojure
hmmm... this is strange. I am getting the classic The video is
currently unavailable. Learn more crap ...
Jim
On 04/08/13 20:59, Frank Hale wrote:
That video seems to work fine for me.
On Sun, Aug 4, 2013 at 3:56 PM, Jim - FooBar(); jimpil1...@gmail.com
mailto:jimpil1...@gmail.com wrote
your extension point on Number is never fired because 10 is a Long.
Generally speaking extending protocols to interfaces is not
suggested...I've been bitten a couple of times in particular whenever
I'm extending to 2 different interfaces that *are* related...You can
certainly do it but you
it here :
https://github.com/jimpil/hotel-nlp/blob/master/src/hotel_nlp/tools/normalito/core.clj
500 lines of pure protocol extension points! It is that long because a
requirement of mine was not to output the same type as the input.
Jim
On 02/08/13 11:55, Jim - FooBar(); wrote:
your
1 - 100 of 698 matches
Mail list logo