Hi,
I'm announcing my first (epsilon) contribution back to the Erlang community:
https://github.com/txrev319/erldn -- a slightly hacked up fork of
the original erldn.
The main use case is:
* I'm using clojurescript on the client side. I need to use erlang
on the server side.
The
Hi,
I have created a Leiningen template that creates a new project setup to use
Stuart Sierra's component library
(https://github.com/stuartsierra/component) and reloaded workflow
(http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded)
See
I'm trying to reference one of my leiningen projects from another, and not
succeeding. My error must be simple and obvious...
Essentially the projects 'poker' and 'testgen' are both in
/home/simon/workspace, and both are standard leiningen projects using just
the default project template. I've
Use lein install
This command will install your testgen jar in your local repo folder.
This local repo is hit first when searching for a dependency before escalating
to network repos if the dependency is not found there first.
No need for a uberjar.
Luc P.
I'm trying to reference one of my
Or, you could make a directory called 'checkouts' inside the poker project
directory, and put a symlink in there to the testgen project directory.
Lein will look in the checkouts directory before it looks to any
repository. See here:
For some time I had a suspicion that in Clojure we have a fundamental
problem with efficient math and today I've tried to test it.
Let's say we have a pretty simple function:
(ns testapp.core
(:require
[criterium.core :as cr]
[primitive-math :as p]
[no.disassemble :as nd]))
(set!
Hi,
maybe this question was already put it here, but can someone explain how
exactly work internal a function wrapped with lazy-seq keyword. For example
in the below code sample:
(
defn test-fc
sum of all collection elements using recursion and laziness
[coll]
(letfn [(sum-fc [sum
First have a look at delay (and clojure.lang.Delay) and try to understand
it. LazySeq is just a delay with a fancy interface (supporting seq, first
and rest). There is no recursion per se in the LazySeq object. What makes
it harder to understand is the idiom of using lazy-seq together with cons
That's neat. I didn't know you could do that. Thanks
On Sunday, 6 April 2014 17:04:48 UTC+1, Jony Hudson wrote:
Or, you could make a directory called 'checkouts' inside the poker project
directory, and put a symlink in there to the testgen project directory.
Lein will look in the
I was getting warnings before I added the exclude so its definitely there.
I'm mobile at the mo. Will post more detail when I get to a proper computer
—
Sent from Mailbox for iPhone
On Sun, Apr 6, 2014 at 7:52 PM, James Reeves ja...@booleanknot.com
wrote:
As far as I know, there's no
Sorry I am not taking the time to try out the change for you and see
whether it makes the desired difference in performance happen, but I do
know that the ^double type hint on return values should be on the argument
vector, not on the var. So instead of your abs-diff, try this, and
similarly for
I'm trying to right-pad a string up to 9 characters, for example 12345
should become 12345, and the only idea I've come up with so far is to
use clojure.core/format which states: Formats a string using
java.lang.String.format, see java.util.Formatter for format string syntax.
However,
OK, now I understand (String/format '%-9s' (to-array 12345)) and
(String/format
'%-9s' (to-array '(\1 \2 \3 \4 \5))) both return '1 ' - because in each
case the array returned from to-array contains individual characters and
only the first gets formatted using the format string - but that
Shame on me! Now the difference is around 10%. Much better!
Case closed, I suppose :)
On Sunday, April 6, 2014 11:24:05 PM UTC+4, Andy Fingerhut wrote:
Sorry I am not taking the time to try out the change for you and see
whether it makes the desired difference in performance happen, but I do
Paul, can you double-check the result you are getting from (format '%-9s'
12345) ?
For example, wrap it in a call to count, i.e. (count (format '%-9s'
12345)). I get the expected string back from format, and the expected
length of 11 characters, on all of these Clojure/JVM/OS combos I tested:
Interesting.
The result of (format '%-9s' 12345) displays as '12345 ' - added by
LT. Yet (count (format '%-9s' 12345)) returns 11, as you say, which is
correct.
Am I looking at a LightTable bug then?
On Sunday, 6 April 2014 13:42:40 UTC-6, Andy Fingerhut wrote:
Paul, can you double-check
Using Clojure from the REPL will also show double quotes around the result
of format, since the result is a string and that is how the Clojure REPL
shows string values, so that is not specific to LightTable.
The display of the wrong number of spaces between the double quotes could
be a LightTable
IMO, the times when it makes sense to use infix notation are fairly few,
anyway. One could write the above as:
(/ (* 2 x1 x2)
(+ x1 x2))
I find this a very convincing counter-argument, in general. (I also think
the random examples I cooked up were a poor demonstration.)
But it
Andy, thanks for your help.
I've checked and the displayed result is different only in LightTable. When
I execute the format functions from a CLI REPL I get the correct number of
characters displayed. I've checked the LT issues and can't see anything
that matches, so I'll probably raise it as
You can possibly get rid of the var dereference by dereferencing at
compile-time. Of course this means you lose the benefits of vars, too.
It's just super-easy when needed :-).
(defn a [] 1)
(defn b [] (dotimes [_ 10] (a)))
(time (b))
Elapsed time: 1097.082556 msecs
(time (b))
On 6 April 2014 21:50, Joshua Brulé jtcbr...@gmail.com wrote:
But it still seems to me that in the case *exactly three forms* - binary
function and arguments - curly infix can be a solid improvement on
readability.
(map (fn [x] (cond (zero? {x mod 15}) FizzBuzz
(zero? {x
Hi sorin,
your function computes a sequence of just one element (the sum of the
collection members), so I would say it is not a typical use of (lazy) seqs
to see that the code is indeed lazy, you can try:
(def x (test-fc (range 210432423543654675765876879)))
and see that it returns
On Apr 5, 2014, at 8:51 PM, Jason Felice jason.m.fel...@gmail.com wrote:
I focus on expressivity, specifically because of the write-only phenomenom.
This isn't peculiar to clojure; this happened a lot in the Perl days (so much
so, that that's where I remember write-only code being coined).
Though if I was going to write the above, I'd probably write:
(divides-exactly? x 5)
I didn't think of that, and yes, I'd agree that that's better.
I think my main problem with this proposed syntax is that it doesn't
represent a data structure.
And *now *I'm convinced. I was thinking of
24 matches
Mail list logo