InvokeDynamic

2014-04-04 Thread Robin Heggelund Hansen
Hi! Did someone ever look at supporting InvokeDynamic for Clojure? I've read a couple of blogs and it seemed interesting, would be cool to know if there actually were any advantages in practice. -- You received this message because you are subscribed to the Google Groups Clojure group. To

Re: How to troubleshoot FileNotFoundException: Could not locate clojure/tools/namespace/parse...?

2014-04-04 Thread Jakub Holy
Thank you all! @Stuart Great to know that 0.2.1 is backwards compatible. @Sean You are right about running it separately. But I am lazy and it is easier to be able to just run (sdoc) from repl and get the ns browser up. On the other hand, it is perhaps not so smart to pollute one's profile with

Re: Integration with Mutable Object-Oriented Eventing Hell

2014-04-04 Thread Christian Eitner
Hi Luca, On Thursday, April 3, 2014 11:57:27 AM UTC+2, icamts wrote: Hi Christian, I think you are looking for this. http://en.wikipedia.org/wiki/Facade_pattern In clojure you can use a def for each private member of the facade. Alternatively you can write a function to instantiate and

Re: InvokeDynamic

2014-04-04 Thread Plínio Balduino
Hi, Hansen Fogus (from here) and Nutter (from JRuby) wrote nice posts about it. http://blog.fogus.me/2011/10/14/why-clojure-doesnt-need-invokedynamic-but-it-might-be-nice/ http://blog.headius.com/2011/10/why-clojure-doesnt-need-invokedynamic.html?m=1 Plinio Balduino 11 982 611 487 On

Re: InvokeDynamic

2014-04-04 Thread Robin Heggelund Hansen
Yeah, those were the blog posts I've read, but I can't see that this is actually being worked on for Clojure? 4. apr. 2014 kl. 11:43 skrev Plínio Balduino pbaldu...@gmail.com: Hi, Hansen Fogus (from here) and Nutter (from JRuby) wrote nice posts about it.

Re: InvokeDynamic

2014-04-04 Thread Plínio Balduino
The guys from core team will correct me if I say any bs, but I think it's not possible to keep Clojure compatible with Java 6, as Clojure 1.6 is, and use InvokeDynamic bytecode in the same binary. DynJS, for example, is not compatible with Java 6. Anyway, it would be nice to see any

Re: InvokeDynamic

2014-04-04 Thread Ragnar Dahlén
You may find this thread enlightening: https://groups.google.com/d/msg/clojure-dev/PuV7XTps9vo/SkkNuiynKfUJ /Ragnar On Friday, 4 April 2014 10:44:42 UTC+1, Robin Heggelund Hansen wrote: Yeah, those were the blog posts I’ve read, but I can’t see that this is actually being worked on for

Re: InvokeDynamic

2014-04-04 Thread Robin Heggelund Hansen
Thank you! 4. apr. 2014 kl. 12:35 skrev Ragnar Dahlén r.dah...@gmail.com: You may find this thread enlightening: https://groups.google.com/d/msg/clojure-dev/PuV7XTps9vo/SkkNuiynKfUJ /Ragnar On Friday, 4 April 2014 10:44:42 UTC+1, Robin Heggelund Hansen wrote: Yeah, those were the blog

Re: InvokeDynamic

2014-04-04 Thread Alex Miller
I agree that we cannot (yet) cut support for Java 6 but we continue to watch polls and usage closely. Java 6 has been EOL'ed for a while now and usage continues to drop. However, there are a few minor JDK-specific bits already in Clojure and it would be entirely possible to handle separate

Re: InvokeDynamic

2014-04-04 Thread Robin Heggelund Hansen
Great to hear, I'm looking forward to progress :) 4. apr. 2014 kl. 14:45 skrev Alex Miller a...@puredanger.com: I agree that we cannot (yet) cut support for Java 6 but we continue to watch polls and usage closely. Java 6 has been EOL'ed for a while now and usage continues to drop. However,

Re: Integration with Mutable Object-Oriented Eventing Hell

2014-04-04 Thread icamts
Hi Christian, I've been a bit too technical. What I mean is give your OO system a new interface made of functions. Choose functions according to your needs and develop a layer of functions that can create and access your objects instances. It's my opinion this is the stateful bridge in your

Thoughts on a curly-infix reader macro?

2014-04-04 Thread Joshua Brulé
Proposal: For an *odd* number of forms a, x, b, ... {a x b x c ...} = (x a b c ...) {a x b y c ...} = (*nfx* a x b y c ...) Reasoning: Even after a lot of practice, prefix math is still harder (at least for me...) to read than non-prefix math. The [], () and matching delimiters are already

Proxy vs. glue class

2014-04-04 Thread Anvar Karimson
Hi, I am trying to understand what the best course of action would be in the following scenario: I have a Java base class that I need to extend. The class is fundamental to my application and will be running fairly hot compared to other bits of code in the application. Therefore I want it to

Re: Integration with Mutable Object-Oriented Eventing Hell

2014-04-04 Thread Phillip Lord
Christian Eitner 7enderh...@gmail.com writes: Hi Christian, I think you are looking for this. http://en.wikipedia.org/wiki/Facade_pattern In clojure you can use a def for each private member of the facade. Alternatively you can write a function to instantiate and return private

Re: Proxy vs. glue class

2014-04-04 Thread Phillip Lord
Anvar Karimson an...@karimson.com writes: I am trying to understand what the best course of action would be in the following scenario: I have a Java base class that I need to extend. The class is fundamental to my application and will be running fairly hot compared to other bits of code

Re: Thoughts on a curly-infix reader macro?

2014-04-04 Thread Steve Miner
The desire (and rejection) of infix notation for Lisp is as old as the hills. Therefore we expect future generations of Lisp programmers to continue to reinvent Algol-style syntax for Lisp, over and over and over again, and we are equally confident that they will continue, after an initial

Re: Proxy vs. glue class

2014-04-04 Thread Anvar Karimson
Is that via gen-class? I have to admit that I am not very familiar with gen-class, is it still possible to use the class from Clojure? Yes, that is probably the most pragmatic choice, premature optimization and all that. On Friday, 4 April 2014 15:03:00 UTC+1, Phillip Lord wrote: Anvar

Re: Thoughts on a curly-infix reader macro?

2014-04-04 Thread Jason Felice
Odd-entry-count maps would have corner cases: One would need to use an even number of unary operators. If an odd number of unary operators were used, what looked like a valid expression would become a map, and that might be hard to figure out. Also, since the order of entries in a map is not

Re: Proxy vs. glue class

2014-04-04 Thread Phillip Lord
Yeah, gen-class is the thing. Proxy, well, proxies, but genclass produces a statically compiled ahead of time class. It's a real Java class, so yes, you can use it from Clojure like any other Java class. Genclass is a little more painful than proxy, but probably a little less painful than having

Re: Proxy vs. glue class

2014-04-04 Thread Anvar Karimson
Ok, thanks! I will have a look! On Friday, 4 April 2014 16:43:20 UTC+1, Phillip Lord wrote: Yeah, gen-class is the thing. Proxy, well, proxies, but genclass produces a statically compiled ahead of time class. It's a real Java class, so yes, you can use it from Clojure like any other Java

Changing a value in let

2014-04-04 Thread Plínio Balduino
Hi there I wrote this code expecting an error, but it worked: (let [x 3 x (* valor 2)] x) ; 6 Is It the expected behavior or, considering that a local binding could not be modified, it should really raise an error? Thank you Plínio -- You received this message because you are

Re: Changing a value in let

2014-04-04 Thread Timothy Baldridge
This is not modifying the value it's creating a new scope with a new version of x. The binding above is shorthand for: (let [x 3] (let [x 42] (println x)) (println x)) ;; prints: 42 3 Timothy On Fri, Apr 4, 2014 at 10:23 AM, Plínio Balduino pbaldu...@gmail.comwrote: Hi there I

Re: Changing a value in let

2014-04-04 Thread Plínio Balduino
Thank you I imagined something like that. Anyway, as the second binding is shadowing the first, there's no way to access the first value, right? Plínio On Fri, Apr 4, 2014 at 1:26 PM, Timothy Baldridge tbaldri...@gmail.comwrote: This is not modifying the value it's creating a new scope with

Re: Changing a value in let

2014-04-04 Thread Timothy Baldridge
That's correct, and often clojure compilers (like ClojureScript) many actually completely rename the variable to something else. Timothy On Fri, Apr 4, 2014 at 10:34 AM, Plínio Balduino pbaldu...@gmail.comwrote: Thank you I imagined something like that. Anyway, as the second binding is

Re: Thoughts on a curly-infix reader macro?

2014-04-04 Thread Alex Miller
Incanter supports this with the $= prefix: ($= 7 + 8 - 2 * 6 / 2) http://data-sorcery.org/2010/05/14/infix-math/ Might be worth looking at... On Thursday, April 3, 2014 11:17:32 PM UTC-5, Joshua Brulé wrote: Proposal: For an *odd* number of forms a, x, b, ... {a x b x c ...} = (x a b c

Re: InvokeDynamic

2014-04-04 Thread Plínio Balduino
I strongly recommend to talk with dynjs guys about invokedynamic. Dynjs is a ECMAScript engine written in Java 7 that was intended to use all the power of invokedynamic. Again, they can correct me if I'm saying bananas, but it looks lie Java 7 has some issues in invokedynamic implementation and

Online Gorilla REPL worksheet viewer

2014-04-04 Thread Jony Hudson
Hi folks, I've got a very simple online viewer for Gorilla REPL worksheets going here: http://gorilla-repl.org/viewer.html It's free, with no registration or other burdensome business. You use it by uploading your worksheet to GitHub, either as part of a project, or to a Gist, and then

Re: Changing a value in let

2014-04-04 Thread Plínio Balduino
Ouch. Now I realized that it's exactly what happens when you do this to debug a sequential binding. (let [x 35 _ (println x is x) y (* 35 3) _ (println y is y)] ; some code ) Thank you for the elucidation. Plínio On Fri, Apr 4, 2014 at 1:36 PM, Timothy Baldridge

Re: Thoughts on a curly-infix reader macro?

2014-04-04 Thread James Reeves
Why bother with a reader macro, when you can use a normal macro? (infix (2 * x1 * x2) / (x1 + x2)) 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)) Which to me actually seems more readable

Re: Thoughts on a curly-infix reader macro?

2014-04-04 Thread Michael Fogus
I prefer Unfix -- http://fogus.me/fun/unfix/ ;-) On Fri, Apr 4, 2014 at 12:45 PM, Alex Miller a...@puredanger.com wrote: Incanter supports this with the $= prefix: ($= 7 + 8 - 2 * 6 / 2) http://data-sorcery.org/2010/05/14/infix-math/ Might be worth looking at... On Thursday, April 3,

Re: cljsbuild dev/release, different debug levels

2014-04-04 Thread Daniel Kersten
I'd love to know the correct answer to this too, but in the meantime, here's how I've been doing it: I define the release version in some namespace. To use it, I require this namespace. Eg release-namespace/func Then I create a separate file for the debug build and I require the release

Re: Thoughts on a curly-infix reader macro?

2014-04-04 Thread Alex Miller
I knew there was another one out there, but couldn't remember whose... ! Thanks... On Friday, April 4, 2014 2:36:59 PM UTC-5, Fogus wrote: I prefer Unfix -- http://fogus.me/fun/unfix/ ;-) On Fri, Apr 4, 2014 at 12:45 PM, Alex Miller al...@puredanger.comjavascript: wrote: Incanter

list all functions in namespace?

2014-04-04 Thread Christopher Howard
Is there some trick Clojure command to list all functions defined in a namespace? -- 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 members are moderated - please be

Re: list all functions in namespace?

2014-04-04 Thread Stephen Gilardi
On Apr 4, 2014, at 7:53 PM, Christopher Howard cmhowa...@alaska.edu wrote: Is there some trick Clojure command to list all functions defined in a namespace? http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/ns-publics is a good start. --Steve -- You received this message

Re: Proxy vs. glue class

2014-04-04 Thread Colin Fleming
FWIW, in Cursive, which is a big ball of mixed Clojure + Java, I've given up trying to use gen-class and have started using Java shims for everything. I like it a lot more than gen-class, which I always feel like I'm fighting. With the new Java-Clojure API in 1.6 (or the equivalent using RT.var()

Re: InvokeDynamic

2014-04-04 Thread Colin Fleming
My understanding is that invokedynamic was very problematic in Java 7, but is quite a different design and works much better in Java 8. I'd expect it to be much more heavily optimised in Java 8 since it's used by a core Java feature (lambdas). Unfortunately targeting Java 8 only is probably not

Re: list all functions in namespace?

2014-04-04 Thread guns
On Fri 4 Apr 2014 at 03:53:54PM -0800, Christopher Howard wrote: Is there some trick Clojure command to list all functions defined in a namespace? I use these functions to create cheatsheets on the fly: (defn fn-var? [v] (let [f @v] (or (contains? (meta v) :arglists) (fn? f)

Re: anyone in Santa Cruz?

2014-04-04 Thread Kathy Sierra
I'm also in Santa Cruz, and interested. -- 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 members are moderated - please be patient with your first post. To

Re: list all functions in namespace?

2014-04-04 Thread Mars0i
(doc dir) - clojure.repl/dir ([nsname]) Macro Prints a sorted directory of public vars in a namespace On Friday, April 4, 2014 6:53:54 PM UTC-5, Christopher Howard wrote: Is there some trick Clojure command to list all functions defined in a namespace? -- You