Re: Simple Clojure/Java interop

2011-04-08 Thread MohanR
That was my guess too and when I specify swank-clojure-extra-vm-args it seems to work. -- 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

help--reading keyboard input from Clojure is surprisingly difficult

2011-04-08 Thread Gregg Williams
Having worked with Clojure for over a year, I can sympathize with Clojure beginners (like myself) who find it extremely difficult to do simple things with Clojure. (It took me weeks to get Clojure working with Emacs, Swank, and the Clojure Debugging Toolkit, but I'm persistent.) Now this. I'm

Re: minor pauses

2011-04-08 Thread Michael Jerger
Hi, A couple of hundred ms seems very very plausible for GC. What is your target/desired maximum pause time? below the 10s of milliseconds if possible. There is a real timeable vm from AICAS (http://www.aicas.com/). If 10s of milliseconds mean 10 ms - than you will nead a real fast

Re: help--reading keyboard input from Clojure is surprisingly difficult

2011-04-08 Thread Ken Wesson
On Fri, Apr 8, 2011 at 2:52 AM, Gregg Williams greg...@innerpaths.net wrote: Having worked with Clojure for over a year, I can sympathize with Clojure beginners (like myself) who find it extremely difficult to do simple things with Clojure. (It took me weeks to get Clojure working with Emacs,

Re: help--reading keyboard input from Clojure is surprisingly difficult

2011-04-08 Thread Meikel Brandmeyer
Hi, I put that into greet.clj. --8---8---8-- (def state (atom :running)) (println Where to send the greetings?) (while (= @state :running) (let [guy (read-line)] (if (pos? (count guy)) (println (str Hello, guy !)) (reset! state :stop --8---8---8-- And then start the

Re: help--reading keyboard input from Clojure is surprisingly difficult

2011-04-08 Thread Meikel Brandmeyer
Hi, On 8 Apr., 08:52, Gregg Williams greg...@innerpaths.net wrote: I assume that running clojure completely manually from the CLI will work, but honestly, I'd like to have some support for interactivity and/or debugging this program, which could grow over time. Ah. Ok. It's a tooling issue.

ANN: A Clojure library for the Facebook Graph API - clj-facebook-graph

2011-04-08 Thread Max Weber
Hello everyone, I like to introduce you to clj-facebook-graph, it is a Clojure client for the Facebook Graph API and it is based on clj-http and Ring. I have written a blog post about how to leverage clj-facebook-graph to query the Facebook Graph API:

Re: ANN: A Clojure library for the Facebook Graph API - clj-facebook-graph

2011-04-08 Thread Alfredo
Hi Max, I'm already using your library for a university project, and it's very well written. Good job! Best, Alfredo On Apr 8, 12:16 pm, Max Weber weber.maximil...@googlemail.com wrote: Hello everyone, I like to introduce you to clj-facebook-graph, it is a Clojure client for the Facebook

examples in doc strings

2011-04-08 Thread Jeff Rose
I notice that in clojure.core some doc strings contain examples while others don't. Specifically today I was checking on the arguments for defmulti and defmethod, and given the doc strings it still isn't entirely clear how to use them. For example, you have to know how a fn-tail should look. In

labrepl IntelliJ incanter Ubuntu - No X11 DISPLAY variable was set

2011-04-08 Thread peterg
Hi All, I have been going through the set-up instructions for various environments as described on https://github.com/relevance/labrepl. All have misbehaved (for me) so-far. Delighted to find the IntelliJ environment seemed to run as required. I am up to the exercise: Its All Data/A Little

Re: examples in doc strings

2011-04-08 Thread Meikel Brandmeyer
Hi, it was discussed before whether examples should go into the docstring. Or to an :examples metadata to be even executable at the repl. Some expressed the opinion that docstring should be short and that such additional documentation should go somewhere else. I don't remember what the outcome of

Idiomatic way to overload +

2011-04-08 Thread Alfredo
Hi to everyone, I know that may sound a bit mad, but I need this kind of abstraction to keep my code as aligned as possibile to a legacy one. I'm the developer of the clj3D library. I want to overload the + function in order to be able to do this: (+ a b) ;= ab or this: (+ [1 2] [3 4]) ;= '(1 2

Re: Announcement: pretzel - a predicate library + call for suggestions

2011-04-08 Thread Joost
James Reeves wrote: On 7 April 2011 20:03, Joost jo...@zeekat.nl wrote: Yup. I'm mostly in the same boat. That's why all the predicates I've produced for now are in the pretzel.strings namespace. I expect to end up with few non-string predicates, but those will have to go into

Re: Idiomatic way to overload +

2011-04-08 Thread Meikel Brandmeyer
Hi, you can always fully qualify the original +: clojure.core/+. Or you specify a rename in the namespace clause. (ns foo.bar (:refer-clojure :rename {+ core-+})) Then you can access the original + as core-+. I don't believe it is idiomatic to overload + in such a way. (No matter how to

Re: Idiomatic way to overload +

2011-04-08 Thread Meikel Brandmeyer
Hi again, On 8 Apr., 14:45, Meikel Brandmeyer m...@kotka.de wrote: I don't believe it is idiomatic to overload + in such a way. (No matter how to access the original one.) That is if you want to (+ 1 2) still to be 3. Of course you can the *replace* +. That's perfectly ok. Sincerely Meikel

Re: Idiomatic way to overload +

2011-04-08 Thread Alfredo
The point is that I want to be able to use the original one in a seamless way. In other word, I would like to offer the new capabilities without compromising the user experience or the pre- existing libraries that use +. On Apr 8, 2:45 pm, Meikel Brandmeyer m...@kotka.de wrote: Hi, you can

Re: Idiomatic way to overload +

2011-04-08 Thread Meikel Brandmeyer
Hi, that's the user's choice. You just provide your + function and the user has the choice to replace the core + in his namespace with yours. Or to use some-alias/+ for your +. Or to fully qualify your.library/+. You can't compromise other peoples namespaces with your own functions. Sincerely

Re: Idiomatic way to overload +

2011-04-08 Thread Alfredo
Hi, I know that it's a user's choice, but I'm wondering if it's possibile to offer a + function that it's extended to other datatypes -with or without protocols - and still able to be applied to Numbers :) Bye, Alfredo On Apr 8, 2:56 pm, Meikel Brandmeyer m...@kotka.de wrote: Hi, that's the

Re: Idiomatic way to overload +

2011-04-08 Thread Meikel Brandmeyer
Hi, On 8 Apr., 15:02, Alfredo alfredo.dinap...@gmail.com wrote: I know that it's a user's choice, but I'm wondering if it's possibile to offer a + function that it's extended to other datatypes -with or without protocols - and still able to be applied to Numbers :) Yes. It is. Just provide

Re: Idiomatic way to overload +

2011-04-08 Thread Alfredo
Thanks for your help :) Bye Alfredo On Apr 8, 3:10 pm, Meikel Brandmeyer m...@kotka.de wrote: Hi, On 8 Apr., 15:02, Alfredo alfredo.dinap...@gmail.com wrote: I know that it's a user's choice, but I'm wondering if it's possibile to offer a + function that it's extended to other datatypes

Re: examples in doc strings

2011-04-08 Thread Jeff Rose
Yeah, I've got a permanent clojuredocs tab open all the time, but still it would be nice to settle this discussion, as currently their are doc strings that require a google search or a look at the source to see what they mean though, which is not ideal. Many of us are happy to help if we can have

Variable types changes over namespaces

2011-04-08 Thread Linus Ericsson
I find this behaviour a little surprising: --foo/core.clj: (ns foo.core (:require [foo.bar :as test])) (def ark (test/a-var test/another-var)) --foo/bar.clj: (ns foo.bar) (def a-var {:animal dog}) (def another-var {animal: cat}) REPL: in the repl I get: foo.core (map class ark) =

Re: Variable types changes over namespaces

2011-04-08 Thread Meikel Brandmeyer
Hi, On 8 Apr., 16:37, Linus Ericsson oscarlinuserics...@gmail.com wrote: (def ark (test/a-var test/another-var)) This is not the whole truth. I think you wrote here (def ark '(test/a- var test/another-var)). With the above code ark should be nil. You probably want (def ark (list ...)) or (def

Re: help--reading keyboard input from Clojure is surprisingly difficult

2011-04-08 Thread Armando Blancas
Can anybody suggest anything that will enable me to write this simple program that any middle- school student would find, well, basic if written in BASIC? Thanks. Write your own read function to delegate to (read-line) or, in debug mode, read the next line from some file; then keep various

Re: examples in doc strings

2011-04-08 Thread Justin Kramer
Another option is to create a function which pulls examples from clojuredocs.org on the fly (it has an API) and displays them in the REPL. I made a proof-of-concept for this but using the now-defunct Clojure Examples Wiki: https://gist.github.com/470031. The utility of something like this would

Re: Idiomatic way to overload +

2011-04-08 Thread Laurent PETIT
I presume that your tests are done in the same namespace as where the protocol is defined. For real user code, where the using namespace will not be equal to the + protocol defining namespace, your users will have to somehow import the + into their namespace. As long as you don't magically

Re: Idiomatic way to overload +

2011-04-08 Thread Alfredo
Thanks for the advice :) Best, Alfredo On Apr 8, 5:54 pm, Laurent PETIT laurent.pe...@gmail.com wrote: I presume that your tests are done in the same namespace as where the protocol is defined. For real user code, where the using namespace will not be equal to the + protocol defining

Re: examples in doc strings

2011-04-08 Thread Shantanu Kumar
Jark does exactly this: http://icylisper.in/jark/doc.html Regards, Shantanu On Apr 8, 8:45 pm, Justin Kramer jkkra...@gmail.com wrote: Another option is to create a function which pulls examples from clojuredocs.org on the fly (it has an API) and displays them in the REPL. I made a

Re: examples in doc strings

2011-04-08 Thread Mark Fredrickson
I will put in a plug for my much neglected postdoc https://github.com/markmfredrickson/postdoc This takes the :examples approach (though it namespaces it within another map: metadata - :postdoc - {:examples ... :see-also ... }). Some ways to focus your effort would be to start a project that

Re: help--reading keyboard input from Clojure is surprisingly difficult

2011-04-08 Thread Rasmus Svensson
See this tread for why stdin is not directly available with lein: http://groups.google.com/group/leiningen/browse_thread/thread/f9f9ed97eb8a2928/ccab95588ef50d05?lnk=gstq=stdin This is currently impossible due to a bug in ant; it just swallows stdin completely, and they seem to have no intention

Re: minor pauses

2011-04-08 Thread Mikhail Kryshen
I once wrote a Clojure app that communicates with jackd audio server through JNA in real time. It periodically fills an audio buffer and calls a couple of native functions, and it works reliably with an audio buffer of 10ms. I tried it under OpenJDK on Linux. So the HotSpot VM used in OpenJDK and

Re: Announcement: pretzel - a predicate library + call for suggestions

2011-04-08 Thread James Reeves
On 8 April 2011 08:43, Joost jo...@zeekat.nl wrote: What about predicates that operate on numbers encoded as strings? e.g. 1 or 4.2. IMO, they should be in the strings package. The strings namespace could get rather large then, considering that strings are how most raw data is represented.

Where is the javadoc for clojure.lang ?

2011-04-08 Thread Dean
The link to the API from clojure.org does not contain anything from clojure.lang. Where do I find javadoc for the clojure.lang package? Also, is there downloadable javadoc? Thanks. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this

Re: Announcement: pretzel - a predicate library + call for suggestions

2011-04-08 Thread Ken Wesson
On Fri, Apr 8, 2011 at 9:48 PM, James Reeves jree...@weavejester.com wrote: I'm saying that if a predicate is passed a value that doesn't match a precondition, the predicate could return a truthy value, rather than false. Better yet: maybe we're looking at this backwards. Maybe what we want

Re: help--reading keyboard input from Clojure is surprisingly difficult

2011-04-08 Thread Gregg Williams
Thanks to all for your helpful replies. Mikel's greet.clj is something that just works, but it requires invoking Java through the command line. If I go that route, the code that I wrote will work...won't it? (I'll try.) But look at the proposed solutions--for example, It's easier to do something

Re: help--reading keyboard input from Clojure is surprisingly difficult

2011-04-08 Thread Armando Blancas
My modest proposal: [snip] Have you considered a grant from the National Science Foundation? Dennis Ritchie is still around in what remains of Bell Labs; maybe he could help us read from standard input. -- You received this message because you are subscribed to the Google Groups Clojure group.