Re: [$Bounty] Emacs plugin for Typed Clojure

2014-02-12 Thread john walker
Ahh, this turned out to be fairly interesting. My first thought was to check the aliases using (ns-alias), but it turns out that re-evaluating a namespace after removing the alias leaves the original aliases in place. So I'm just going to use a regex, which is probably easier anyway. On

Re: [$Bounty] Emacs plugin for Typed Clojure

2014-02-12 Thread Ambrose Bonnaire-Sergeant
Hi John, I don't mind that ns-aliases can go out of date. Please use the output of ns-alias as authoritative, and make a documentation note of this quirk. Thanks, Ambrose On Wed, Feb 12, 2014 at 4:03 PM, john walker john.lou.wal...@gmail.comwrote: Ahh, this turned out to be fairly

Re: [$Bounty] Emacs plugin for Typed Clojure

2014-02-12 Thread john walker
Added. The next big thing I see is fixing which-function. On Wednesday, February 12, 2014 3:07:44 AM UTC-5, Ambrose Bonnaire-Sergeant wrote: Hi John, I don't mind that ns-aliases can go out of date. Please use the output of ns-alias as authoritative, and make a documentation note of this

Re: [$Bounty] Emacs plugin for Typed Clojure

2014-02-12 Thread john walker
Well, that was easy to find. It will be fixed in the next version of clojure mode. If you are impatient, do C-h f clojure-match-next-def, click on clojure-mode.el and replace the line (when (re-search-backward ^(def\sw* nil t) with (when (re-search-backward ^(def\\sw* nil t) then

Re: cond- variant?

2014-02-12 Thread Alex Baranosky
I wrote pred-cond for Midje way back, which does what you want. https://github.com/marick/Midje/blob/master/src/midje/clojure/core.clj#L176 Example use: https://github.com/marick/Midje/blob/master/src/midje/parsing/1_to_explicit_form/facts.clj#L100 Like normal cond pred-cond will short-circuit

Re: ISeq documentation and mutual deftypes.

2014-02-12 Thread Mikera
Clearly they are useful as SPI. But I'd argue they are also API-relevant: if you get hold of a Clojure var through the Java API and invoke it via IFn, then these interfaces are pretty useful to help you construct parameters and deal with return values. They are not completely essential (since

Re: ISeq documentation and mutual deftypes.

2014-02-12 Thread Phillip Lord
Mikera mike.r.anderson...@gmail.com writes: This is useful information - thanks Alex! Might be worth putting some of this on a Clojure.org page somewhere, perhaps linked to the Java interop section? As someone who quite regularly interfaces to Clojure from Java, it would be useful to

Re: ISeq documentation and mutual deftypes.

2014-02-12 Thread Phillip Lord
Brandon Bloom brandon.d.bl...@gmail.com writes: The closest I have got it: (declare create-alice) (declare create-brian) Yup, that's A-OK. You can also just write (declare create-alice create-brian). The tricky bit comes in when you actually need to refer to the types by name

Re: [$Bounty] Emacs plugin for Typed Clojure

2014-02-12 Thread Ambrose Bonnaire-Sergeant
Hi John, I gave it a whirl, it's exactly what I wanted. When you're ready please claim the bounty. Thanks, Ambrose On Wed, Feb 12, 2014 at 4:46 PM, john walker john.lou.wal...@gmail.comwrote: Well, that was easy to find. It will be fixed in the next version of clojure mode. If you are

Re: OT: Enterprise Schedulers

2014-02-12 Thread Adrian Mowat
Hi Luca Thanks for the links! I definitely have a lot of hammock time ahead of me :-) Cheers Adrian On 11 Feb 2014, at 14:37, icamts wrote: Hi Adrian, the answer is more off-topic than the question :) but have a look to Spagic (I'm a member of the developers' team), Mule ESB, Petals ESB

Re: range-sum

2014-02-12 Thread Vincent
On Friday, February 7, 2014 2:23:33 AM UTC, Sean Corfield wrote: On Feb 6, 2014, at 12:58 PM, Stuart Sierra the.stua...@gmail.comjavascript: wrote: I think (reduce + (range N)) is commonly used in **examples**, not necessarily in real applications. I'd have to agree: I don't see

Re: range-sum

2014-02-12 Thread Stuart Sierra
On Wednesday, February 12, 2014 8:46:41 AM UTC-5, Vincent wrote: On a slightly different topic: why reduce and not apply? The implementation of `+` with more than 2 arguments uses `reduce` internally. So they amount to the same thing. There isn't really a performance difference: user=

Re: [$Bounty] Emacs plugin for Typed Clojure

2014-02-12 Thread john walker
OK, thanks! I realigned the repository name / filename / modename to be both more correct and compliant with your fork. My version can now be seen here: https://github.com/johnwalker/typed-clojure-mode I didn't immediately see how to claim a bounty, but I see that the issue has to be marked

Re: [$Bounty] Emacs plugin for Typed Clojure

2014-02-12 Thread Ambrose Bonnaire-Sergeant
I guess it takes awhile to propagate to BountySource. Did you have any projects in mind for GSoC? Perhaps more Typed Clojure work? Thanks, Ambrose On Wed, Feb 12, 2014 at 11:32 PM, john walker john.lou.wal...@gmail.comwrote: OK, thanks! I realigned the repository name / filename / modename to

Re: [$Bounty] Emacs plugin for Typed Clojure

2014-02-12 Thread Alex Ott
Hi John it would be nice to add the ;;;###autoload cookie for minor-mode definition... On Wed, Feb 12, 2014 at 4:32 PM, john walker john.lou.wal...@gmail.comwrote: OK, thanks! I realigned the repository name / filename / modename to be both more correct and compliant with your fork. My

Re: meta circular clojure

2014-02-12 Thread Herwig Hochleitner
2014-02-12 5:18 GMT+01:00 t x txrev...@gmail.com: If no such evaluator exists, where is the complexity of a clojure-in-clojure evaluator that I failed to mention above? Clojure is a compiled language. This means that even if you leave out any platform issues like bytecode generation, there

Re: [$Bounty] Emacs plugin for Typed Clojure

2014-02-12 Thread john walker
Thanks Alex, I've added this. On Wednesday, February 12, 2014 10:39:49 AM UTC-5, Alex Ott wrote: Hi John it would be nice to add the ;;;###autoload cookie for minor-mode definition... On Wed, Feb 12, 2014 at 4:32 PM, john walker john.lo...@gmail.comjavascript: wrote: OK,

Keyword equality check

2014-02-12 Thread Arkadiusz Komarzewski
Hi, I wonder how is equality of keywords implemented in Clojure? I have this piece of Java code executed in one classloader: Keyword a = (Keyword) RT.var(clojure.core, keyword).invoke(keyword); Then, when I pass it to another part of my application (which uses another classloader) and do this:

Re: Keyword equality check

2014-02-12 Thread Jozef Wagner
Interning table uses keyword's symbol as a key, and the symbols are compared by value. See https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Keyword.java#L37 On Wed, Feb 12, 2014 at 5:23 PM, Arkadiusz Komarzewski akomarzew...@gmail.com wrote: Hi, I wonder how is equality

Re: [$Bounty] Emacs plugin for Typed Clojure

2014-02-12 Thread john walker
I don't actually know yet. I have an idea that I'll submit ~Saturday that could be pretty cool. On Wednesday, February 12, 2014 10:37:31 AM UTC-5, Ambrose Bonnaire-Sergeant wrote: I guess it takes awhile to propagate to BountySource. Did you have any projects in mind for GSoC? Perhaps more

Re: meta circular clojure

2014-02-12 Thread Herwig Hochleitner
2014-02-12 5:36 GMT+01:00 Di Xu xudi...@gmail.com: all lisp dialect provide `read` function, so if you want to build an evaluator, you could just use this function and don't need to do lexical and syntax analysis. Maybe your understanding of these terms is different from mine, in my view:

Re: Keyword equality check

2014-02-12 Thread Herwig Hochleitner
I'm willing to bet that both classloaders have the same clojure runtime in a common base classloader. i.e. that cl1.loadClass(clojure.lang.RT) == cl2.loadClass(clojure.lang.RT); If the two clojure runtimes were distinct, the assert would indeed fail. Also .equals return false and this assignment

[ANN] zcube 0.0.1

2014-02-12 Thread Fabien Todescato
Hi, clojure community. It is my pleasure to announce zcube[1], a Clojure library all about counting trees for analytical purposes. The intent is to compute aggregate sums over multiple hierarchical dimensions, based on the (old) algorithmic ideas exposed in [2] by Pr. Minato et Al, and

Re: range-sum

2014-02-12 Thread Vincent
On Wednesday, February 12, 2014 2:47:07 PM UTC, Stuart Sierra wrote: On Wednesday, February 12, 2014 8:46:41 AM UTC-5, Vincent wrote: On a slightly different topic: why reduce and not apply? The implementation of `+` with more than 2 arguments uses `reduce` internally. So they amount to

Re: range-sum

2014-02-12 Thread John Wiseman
In the olden lisp days, reduce was often preferred to apply because apply could hit limits on the number of arguments that could be passed to a function. Is that a potential issue with clojure? Thanks, John On Wed, Feb 12, 2014 at 12:06 PM, Vincent vhenneb...@gmail.com wrote: On Wednesday,

Re: range-sum

2014-02-12 Thread Sean Corfield
On Feb 12, 2014, at 5:46 AM, Vincent vhenneb...@gmail.com wrote: On Friday, February 7, 2014 2:23:33 AM UTC, Sean Corfield wrote: On Feb 6, 2014, at 12:58 PM, Stuart Sierra the.stua...@gmail.com wrote: I think (reduce + (range N)) is commonly used in *examples*, not necessarily in real

Re: cond- variant?

2014-02-12 Thread Sean Corfield
On Feb 12, 2014, at 1:34 AM, Alex Baranosky alexander.barano...@gmail.com wrote: I wrote pred-cond for Midje way back, which does what you want. https://github.com/marick/Midje/blob/master/src/midje/clojure/core.clj#L176 That doesn't appear to thread each expression through the results so it

Re: cond- variant?

2014-02-12 Thread Sean Corfield
Here's what I ended up with - minor variants of cond- and cond- (defmacro condp- Takes an expression and a set of predicate/form pairs. Threads expr (via -) through each form for which the corresponding predicate is true of expr. Note that, unlike cond branching, condp- threading does not

Re: range-sum

2014-02-12 Thread Mars0i
On Wednesday, February 12, 2014 2:33:34 PM UTC-6, John Wiseman wrote: In the olden lisp days, reduce was often preferred to apply because apply could hit limits on the number of arguments that could be passed to a function. Still an issue with some Common Lisps. I've hit the limit in

Re: Keyword equality check

2014-02-12 Thread Alex Miller
I think it's a little more subtle than that. Symbols are composed of a String name and a String namespace. When symbols are created they intern each of those Strings. Interned Strings are comparable by identity across the JVM. Symbol equals() compares name and namespace. Keyword extends from

Re: range-sum

2014-02-12 Thread Mars0i
On Wednesday, February 12, 2014 5:14:42 PM UTC-6, Mars0i wrote: On Wednesday, February 12, 2014 2:33:34 PM UTC-6, John Wiseman wrote: Is that a potential issue with clojure? (range 1) Then copy its output from the terminal window. (apply + 'paste here ) CompilerException

Re: Keyword equality check

2014-02-12 Thread Alex Miller
Reading a little more closely, that's an identity comparison in Java, not an equals comparison in Clojure (who uses Java anyways? :). So I would retract my last statement. The question is really whether the two classloaders are deferring the load of the common class to a parent classloader

Re: range-sum

2014-02-12 Thread John Wiseman
Just to be clear, and to check my understanding, that's not an issue with the number of arguments, right? It's a limit on the size of a literal or something? I ask because (apply + (range 1)) works fine, but maybe I've missed some subtlety. Thanks, John On Wed, Feb 12, 2014 at 3:32 PM,

Re: range-sum

2014-02-12 Thread Mars0i
Good question. I don't know. Maybe it's in the read stage, rather than in evaluating arguments for + ? On Wednesday, February 12, 2014 5:43:18 PM UTC-6, John Wiseman wrote: Just to be clear, and to check my understanding, that's not an issue with the number of arguments, right? It's a

Re: [ANN] zcube 0.0.1

2014-02-12 Thread Timothy Washington
+1 I can already think of a few places I'd like to try this. Looks very cool. Tim Washington Interruptsoftware.com http://interruptsoftware.com On Wed, Feb 12, 2014 at 1:13 PM, Fabien Todescato f...@infologic.fr wrote: Hi, clojure community. It is my pleasure to announce zcube[1], a Clojure