I'm having to do some interop with a proprietary - and erroneously
documented - Java SDK. There's a class C with a method described as
'translate(java.lang.String). Trying to call the method with a Clojure on
an object of class C I got a 'no matching method found' error.
So I used the following
It looks very similar to the pattern I was trying to avoid in the first
place. I've also got the problem of multiple threads (and its been pointed
out that my original solution was not thread safe). In my experience bugs
of an 'extremely rare but could conceivably happen' nature are the sort of
I'm somewhat late to the party, but what the hey - it's a quiet Sunday
afternoon, and for my own amusement I came up with:
(defn spaces [n] (apply str (take n (repeat .
(defn n-a [n] (char (+ n (int \A
(defn a-n [a] (- (int a) (int \A)))
(defn gap [n] (spaces (dec (* 2 n
(defn
Thanks to everyone for the responses. I was completely unaware of
core.memoize although I think there is a very convincing case for delay; I
certainly accept the thread safety problem with the existing code. Action
this day on that one!
I'm inclined to go down the @@ syntactic route, simply in
strictly once
but also (atom) allow for changing the underlying value (i.e. clear the
cache).
On Wednesday, 10 December 2014, Andy Dwelly andyd...@gmail.com
javascript: wrote:
Thanks to everyone for the responses. I was completely unaware of
core.memoize although I think there is a very
Looking through my recent work I see that a number of atoms, swap! and
reset! calls have snuck into my work, usually when there's an expensive
operation like reading and parsing a large file or connecting to a
database. I find I'm doing things like
(def conf (atom nil))
(defn config []
(if
. *grumble* On the
positive side, I'm now in a position to add a useful example to the
grimoire.
-A
On Wednesday, November 26, 2014 7:41:46 AM UTC, Andy Dwelly wrote:
Thanks for both suggestions guys, and yes - I'm using prn-str - apparently
the wrong one. It's a trivial change so I will start
I've recently been serialising some data using Edn, and to date this has
caused no problems. During some tests today, I serialised a string
representing a file path that originated on a windows machine \My
Documents\somedoc.txt. Edn throws a runtime exception when reading this
back claiming:
Thanks for both suggestions guys, and yes - I'm using prn-str - apparently
the wrong one. It's a trivial change so I will start there.
Thanks again, appreciate it.
Andy
On Tuesday, November 25, 2014 2:00:44 PM UTC, James Reeves wrote:
On 25 November 2014 at 12:23, Andy Dwelly andyd
on this
barebones, TODO Getting Started page:
http://om-bootstrap.herokuapp.com/getting-started
Andy Dwelly javascript:
August 28, 2014 at 6:05 AM
I've got a working knowledge of Clojure and I'm trying to extend my reach
into Clojurescript, om, and bootstrap as I want the resulting website
I've got a working knowledge of Clojure and I'm trying to extend my reach
into Clojurescript, om, and bootstrap as I want the resulting website to
look reasonable.
I've worked my way through the om tutorials and I have a simple plain om
example of my own which doesn't use bootstrap.
Apart
On Wednesday, August 6, 2014 12:54:16 AM UTC+1, Phil Hagelberg wrote:
Hello everyone.
I'm happy to announce the release of Leiningen 2.4.3. This release
includes a number of small fixes and one big fix: access to the Central
repository now occurs over HTTPS since Sonatype opened up
12 matches
Mail list logo