You could do what one of my "modern language" (python) students did.
Put the open parens at the end of the line and it looks like python!
(
defun foo (
arg1 arg2 arg3 ) (
let (
tmp1 tmp2 ) (
firstFunction arg1 ) (
secondFunction arg2 ) (
thirdFunction arg3 )))
auggghhh! my eyes! my eyes!!!
Dear all,
when you write a deftype and want to define a hashCode method, it
would be really great to have access to a macro
(construct-hash arg1 argn)
that would compute the hash code of each arguments and combine them in
a good way to produce a hash-code.
Is there anything like that in co
There's the undocumented clojure.core/hash-combine (wrapping a static
method of clojure.lang.Util) which could perhaps be used for this
purpose with reduce. It doesn't appear to be used anywhere, though --
I wonder about its current status...?
At any rate, an officially supported (= documented) to
My rough estimate is that more than 40 replies to that thread heave been
generated up to now (I deleted the 28 ones without reading them after reading
a couple of replies to the original post).
Hmmm,,, I am about to think that we could have powered a small town
with all that electrical nerve impul
I'm sure this is just me being dumb about bindings but I've been
writing tests and I saw in the docs it says you can cause deftest and
with-test to not generate tests if you bind *load-tests* to false -
for production.
I can't quite get my head around how I would bind that variable in a
way that a
Hi Sean,
As far as I know, that feature never saw much use. Most people like to
keep their test and main sources separate, and build tools assume
this.
To bind *load-tests* during compilation, you would need to control
your own build process. Basically, you would have to launch Clojure
and execut
Has anyone actually implemented this sort of placeholder strategy before?
--Robert McIntyre
On Sat, Aug 28, 2010 at 3:04 PM, Michael Wood wrote:
> On 28 August 2010 19:27, Michał Marczyk wrote:
>> On 28 August 2010 19:19, Luke VanderHart wrote:
>>> I'm not just talking about class hierarchy de
That's a neat improvement to be able to ignore the value when you
don't need it, thanks Michał Marczyk.
Also, though both proxies happen to work with clojure's (read) function,
every read operation of the pushback reader would have to be wrapped
in the variable changing code
to guarantee correctn
Hi,
Am 28.08.2010 um 19:09 schrieb Michał Marczyk:
> I'm sure I'm missing lots of things, but I'd love to know which, so --
> please let me know. :-)
In fact, your two-pass scenario is probably the best you can get, since you can
define arbitrary classes in arbitrary namespaces. (Whether this i
Thanx Stuart. I had a feeling it might require that. I've mostly been
using lein and keeping the tests separate but when I saw that in the
docs I thought I'd try it because it would be kinda convenient inside
CCW / Eclipse while developing.
On Sunday, August 29, 2010, Stuart Sierra wrote:
> Hi Se
So I thought I'd see if I could use tests in source code and add a
hook to lein to bind *load-tests* to false around the compile but I'm
missing something...
Here's my hook:
(ns leiningen.notests)
(use 'robert.hooke)
(defn no-tests [task & args]
(binding [clojure.test/*load-tests* false]
Hi,
I have two refs a1, a2. One thread modifies a1, another modifies a2.
Sample code: http://gist.github.com/556679
If I don't ensure any ref in the transaction, the code runs in ~ 0.2
ms.
$ java -cp lib/clojure-1.2.0.jar\;src clojure.main -e "(require 'tt)
(tt/transaction-simul {:ensure2 fals
I'm resurrecting this thread from quite a while ago... I'm very
interested in being able to ensure that the state of a ref is
persisted as part of the same transaction that updates the ref.
Performance is not important; correctness is. Has any further work
been done on this front?
http://groups.
I don't think two pases is enough.
What if a clojure file uses reflection (with macros of course) on a
compiled java file to generate classes, sort of like how lancet works
but generating classes instead of functions?
And then those classes are used from other clojure and java files.
Oh, and the
On an ext4 file system, building 04764db9b takes an awful lot of time:
BUILD SUCCESSFUL
Total time: 1 minute 38 seconds
On a RAM disk on the same system, it's just:
BUILD SUCCESSFUL
Total time: 8 seconds
This seems to be caused by excessive fsync() calls. Are those really
necessary? Or do you
I am using GATE java libs in my clojure code and behaviour of the
application changes after Java class import. I don't even have to
initialize it.
This runs fine (a bit shorter version than it is):
(ns gate
(:import
(gate Gate)
(java.io File)))
(defn gate-init
[gate-home]
(Gate
On Sun, Aug 29, 2010 at 5:27 PM, Sean Corfield wrote:
> So I thought I'd see if I could use tests in source code and add a
> hook to lein to bind *load-tests* to false around the compile but I'm
> missing something...
>
> (defn no-tests [task & args]
> (binding [clojure.test/*load-tests* false]
>
Hello,
I don't know this library specifically, but the NPE is probably occurring in
a static initialisation block. I believe static initialisation occurs when
the class is first loaded.
Regards,
Stuart
On 30 August 2010 06:42, zm wrote:
>
> I am using GATE java libs in my clojure code and beha
18 matches
Mail list logo