Re: Transactional Synchronization in Haswell
First of all, I must say, this TSX stuff is FREAKING AWESOME! I've wanted these features for years. So basically you're going to need two STM solutions, 1) hardware based off of TSX 2) software based, and we'd need the ability to swap these two models out on-the-fly. All you really need is for the VM to somehow expose these new CPU features to the hosted languages. Sadly though, no, I don't think you'll see this in Clojure any time soon. The JVM would have to be updated to support these instructions and some sort of routines would need to be added. Since the JVM strives to be completely cross platform, I don't think we'll see this happening any time soon. But there is hope for variants of clojure that run on other VMs. For instance, my project (shameless plug) clojure-py (https://github.com/halgari/clojure-py), will eventually support the PyPy style of STM. In this case, the pypy JIT could simply generate different JIT code depending on the capabilities of the underlying hardware. Timothy On Wed, Feb 8, 2012 at 1:38 AM, edlich edl...@gmail.com wrote: Hi all, will this RTM have a big language effect on Clojure and other languages? http://software.intel.com/en-us/blogs/2012/02/07/transactional-synchronization-in-haswell/ Best Stefan Edlich -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- “One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.” (Robert Firth) -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
- and -
Could anyone point me to a description of - and -, please? I've seen a few references to them (e.g. git://gist.github.com/1761143.git) but nothing in Programming Clojure. Google doesn't seem to like searching for such strings. Thanks. -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: - and -
- - http://clojuredocs.org/clojure_core/clojure.core/-%3E - http://clojuredocs.org/clojure_core/clojure.core/-%3E%3E On Wed, Feb 8, 2012 at 11:16 AM, Simon Holgate simon.holg...@gmail.com wrote: Could anyone point me to a description of - and -, please? I've seen a few references to them (e.g. git://gist.github.com/1761143.git) but nothing in Programming Clojure. Google doesn't seem to like searching for such strings. Thanks. -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: - and -
Thank you! S -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: - and -
Also, for future reference, symboihound.com is a great tool for programmers. http://symbolhound.com/?q=-%3E+clojure On Wed, Feb 8, 2012 at 11:18 AM, Tamreen Khan histor...@gmail.com wrote: - - http://clojuredocs.org/clojure_core/clojure.core/-%3E - http://clojuredocs.org/clojure_core/clojure.core/-%3E%3E -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Multi-agent framework vs Clojure concurrency
I'm currently working with multi-agent based systems and a teacher showed me the benefits of using JADE framework for those kind of applications. I'm not sure if it's better to use a framework like this one or if it's better to take advantage of Clojure and its refs, agents, atoms How can I compare and choose between them? -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: - and -
On Wed, Feb 8, 2012 at 9:46 PM, Simon Holgate simon.holg...@gmail.com wrote: Could anyone point me to a description of - and -, please? I've seen a few references to them (e.g. git://gist.github.com/1761143.git) but nothing in Programming Clojure. Google doesn't seem to like searching for such strings. These macros are collectively called the threading macros. `-` is called thread first and `-` is called thread last. These macros lets you write deeply nested function invocations in a relatively flat manner. Something like (- foo (bar x) (baz y) (quux z)) gets re-written as (quux (baz (bar foo x) y) z). So `-` basically threads the first expression through the subsequent forms, inserting it as the second item in the list (aka the first arg). Similarly, something like (- foo (bar x) (baz y) (quux z)) gets re-written as (quux z (baz y (bar x foo))). More docs here - http://clojuredocs.org/clojure_core/clojure.core/-%3E http://clojuredocs.org/clojure_core/clojure.core/-%3E%3E Regards, BG -- Baishampayan Ghose b.ghose at gmail.com -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: - and -
I've always wondered why there isn't a thread-in-the-middle macro (or should it be thread-wherever?), with special syntax to indicate where to thread like so: (-- foo (bar x _ y) (baz _ x y) (test x y _)) Should be easy to implement I guess... On Feb 8, 4:29 pm, Baishampayan Ghose b.gh...@gmail.com wrote: On Wed, Feb 8, 2012 at 9:46 PM, Simon Holgate simon.holg...@gmail.com wrote: Could anyone point me to a description of - and -, please? I've seen a few references to them (e.g. git://gist.github.com/1761143.git) but nothing in Programming Clojure. Google doesn't seem to like searching for such strings. These macros are collectively called the threading macros. `-` is called thread first and `-` is called thread last. These macros lets you write deeply nested function invocations in a relatively flat manner. Something like (- foo (bar x) (baz y) (quux z)) gets re-written as (quux (baz (bar foo x) y) z). So `-` basically threads the first expression through the subsequent forms, inserting it as the second item in the list (aka the first arg). Similarly, something like (- foo (bar x) (baz y) (quux z)) gets re-written as (quux z (baz y (bar x foo))). More docs here -http://clojuredocs.org/clojure_core/clojure.core/-%3E http://clojuredocs.org/clojure_core/clojure.core/-%3E%3E Regards, BG -- Baishampayan Ghose b.ghose at gmail.com -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: - and -
On Wed, Feb 8, 2012 at 10:06 PM, Stathis Sideris side...@gmail.com wrote: I've always wondered why there isn't a thread-in-the-middle macro (or should it be thread-wherever?), with special syntax to indicate where to thread like so: (-- foo (bar x _ y) (baz _ x y) (test x y _)) Should be easy to implement I guess... Oh, no. Not again! https://groups.google.com/forum/?fromgroups#!topic/clojure/6Cb8MD5EC3w Regards, BG -- Baishampayan Ghose b.ghose at gmail.com -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Persistent collections and garbage collection
Hi Ron, I think the persistent collections are no different from any other collections from a GC perspective in that you control which references you keep and for how long in your code. After modification some nodes may no longer be referenced and will be eligible for GC so I'm not sure what you mean by not necessarily short lived. Surely what is short lived is completely dependent on the use case? Also, since they are sharing structure they must be better than copy-on-write collections for object creation. That is the whole point. Obviously, compared to mutable collections there is some overhead due to additional node creation but that's a trade off and not relevant to your point about long lived objects. Paudi On 7 February 2012 16:16, pron ron.press...@gmail.com wrote: Hi. I have a question: I love Clojure's persistent collections, but don't they generate many long-lived objects (that go to the surving generations) that are hard to garbage-collect? After all, the discarded nodes after modification are not necessarily short lived. It seems like they would behave badly from the GC perspective. Am I wrong? -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Multi-agent framework vs Clojure concurrency
If the answer is efficiency then I would respond prove it, i.e. produce a test harness that produces the expected load so you can measure performance. Other factors you might consider (when choosing between any different technology): - maturity: how mature is each technology? - adoptability: how accessible is the technology, how effective are the training vehicles (books, courses, public forums/blogs etc.) - nice: how much do you jibe with the technology - some love Java, some hate it - understanding the somewhat subjective measure of intuitiveness is important if it is going to be used on a day to day basis - lastability: it is going to become unsupported before the end-of-life of your project (including maintenance) in other words, you need to answer what are the risks of using technology X. For me, I choose both :) - having an asynchronous message based architecture allows you to write services in Clojure that use all the Clojure goodness or in Scala which use distributed Actors etc. Sometimes thinking bigger makes things simpler - instead of insisting everything is a shipped in a single deployable/technology why not use the right tool for the right job. Sorry - getting off track there -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: - and -
On Feb 8, 2012, at 10:16 AM, Simon Holgate wrote: Could anyone point me to a description of - and -, please? Another thing to check out is Fogus' nice write up (and links) about these and other thrushy combinators: http://blog.fogus.me/2010/09/28/thrush-in-clojure-redux/ bill -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: - and -
Ah, thanks, that's a very interesting thread. To be honest I haven't found myself in a situation where -- would be very useful, it was more of a random thought... On Feb 8, 4:38 pm, Baishampayan Ghose b.gh...@gmail.com wrote: On Wed, Feb 8, 2012 at 10:06 PM, Stathis Sideris side...@gmail.com wrote: I've always wondered why there isn't a thread-in-the-middle macro (or should it be thread-wherever?), with special syntax to indicate where to thread like so: (-- foo (bar x _ y) (baz _ x y) (test x y _)) Should be easy to implement I guess... Oh, no. Not again! https://groups.google.com/forum/?fromgroups#!topic/clojure/6Cb8MD5EC3w Regards, BG -- Baishampayan Ghose b.ghose at gmail.com -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Multi-agent framework vs Clojure concurrency
Thank's Colin, that's what I've been thinking... Maybe some mixing is a better approach, I really enjoy concurrency programming with Clojure, but I think I need to try some other libraries/languages (such as Scala as you mentioned, which is great as well) to see where each one fits in my problem, maybe that would be better. 2012/2/8 Colin Yates colin.ya...@gmail.com If the answer is efficiency then I would respond prove it, i.e. produce a test harness that produces the expected load so you can measure performance. Other factors you might consider (when choosing between any different technology): - maturity: how mature is each technology? - adoptability: how accessible is the technology, how effective are the training vehicles (books, courses, public forums/blogs etc.) - nice: how much do you jibe with the technology - some love Java, some hate it - understanding the somewhat subjective measure of intuitiveness is important if it is going to be used on a day to day basis - lastability: it is going to become unsupported before the end-of-life of your project (including maintenance) in other words, you need to answer what are the risks of using technology X. For me, I choose both :) - having an asynchronous message based architecture allows you to write services in Clojure that use all the Clojure goodness or in Scala which use distributed Actors etc. Sometimes thinking bigger makes things simpler - instead of insisting everything is a shipped in a single deployable/technology why not use the right tool for the right job. Sorry - getting off track there -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: - and -
My Joy of Clojure is on its way. Perhaps I should have waited for its arrival before posting. Thanks for all the useful pointers. Simon -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Suggestions for using MPI in Clojure
Hello all, I have some scientific code written in Lisp (SBCL) that I'd like to convert to Clojure. However, to run efficiently on clusters, I'll need to learn use MPI. I've looked at MPJ-Express here, http://mpj-express.org/ and I understand that in theory it should be consumable in Clojure, and in theory it should be nearly as fast as OpenMPI. Does anyone else have experience or perspectives on this? Should I just give up and rewrite in C++? Thanks for any infomration, Adam -- Invincibility is in oneself, vulnerability in the opponent. -- Sun Tzu -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Print only by clojure code
Hi guys, I have developed a very very little application in clojure that use an external lib in java that i prefer do not touch. The problem is that this lib for some weird reason (debug i guess) print at video a bunch of information useless for me, there is any way to avoid this problem, i mean can i just print what the clojure code actually print and not what also the lib in java print ? I'm sorry for my English... -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Print only by clojure code
It's logging, and assuming the logging implementation it is using log4j, you can specify the logging properties in a properties file, as system properties, or set the properties in code. The easiest way is to place a file called log4j.properties on the classpath (in the resources directory of your project) containing the following: # set root logger level to OFF (OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE, ALL) log4j.rootLogger=OFF On Wed, Feb 8, 2012 at 1:49 PM, Simone Mosciatti mweb@gmail.com wrote: Hi guys, I have developed a very very little application in clojure that use an external lib in java that i prefer do not touch. The problem is that this lib for some weird reason (debug i guess) print at video a bunch of information useless for me, there is any way to avoid this problem, i mean can i just print what the clojure code actually print and not what also the lib in java print ? I'm sorry for my English... -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Domina: html in strings?
Hi David, Luke just accepted my pull request over the weekend that addressed this very issue. As of Monday, you should be able to treat an HTML string like any other DOM content, including querying with xpath and updating text and innerHTML. Bobby On Jan 22, 5:26 am, David Powell d...@djpowell.net wrote: Hi, I'm just starting with clojurescript and domina. I have some html in a string, eg: (def s sectiondivh3Hello/h3/div/section) Is it possible to run xpaths over this node? (nodes s) seems to convert it into some sort of dom object... Is it possible to change the text of the h3 element? Am I going about this wrong - should I be attaching my snippet to the document, and then xpathing it there? -- Dave -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: read password from console
Thanks David and Kevin, I tried System.console() in the code. The mystery is it could work in clojure repl, but System.console() will return null if I put everything into jar package. Per the spec, system.console could return null. I don't quite understand why the two cases are different. Best regards, -stanley On Tue, Feb 7, 2012 at 10:16 PM, David Powell djpow...@djpowell.net wrote: If you have Java 6 (and you probably do), then look at: http://docs.oracle.com/javase/6/docs/api/java/io/Console.htmlhttp://docs.oracle.com/javase/6/docs/api/java/io/Console.html#readPassword%28java.lang.String,%20java.lang.Object...%29 Simple example: (String/valueOf (.readPassword (System/console) Password: nil)) -- Dave -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
No show?
Hi all, I'm curious why the show function got abandoned when migrating from monolithic contrib.repl-utils to clojure.repl? http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go It looks like it would have been useful. Does anything replace it? Thanks. -ken -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Looking for parser generator library
May I also suggest a look at VisualLangLab (http://vll.java.net/)? It's a completely visual environment for developing (see http://vll.java.net/EditingTheGrammarTree.html) and testing (see http://vll.java.net/TestingParsers.html) parsers without using code/ scripts of any kind. Under the hood, its parsers use a Java version of Scala's parser combinator library. The developed parsers can be saved (as an XML file) that can be opened again for further editing, testing, etc. The saved XML file can also be loaded by any client program using a well-documented API (see http://vll.java.net/UsingTheAPI.html) that is usable from any JVM language. But if you must have a library, the classes under net.java.vll.vll4j.combinator are the ones you need. They are named after the classes in the Scala parser combinator library, and work the same way (except the internal DSL functionality). A tutorial that explores the scenarios and examples in chapter 3 (A Quick Tour for the Impatient) of the book The Definitive ANTLR Reference can be found here: http://vll.java.net/examples/a-quick-tour.html There is just one small executable jar you need (double-click to start the IDE). It also contains several bundled examples that you can tinker with, and the same jar works as the API for client programs: http://java.net/projects/vll/downloads/download/VLL4J.jar - Sanjay On Jan 29, 1:44 pm, Roman Perepelitsa roman.perepeli...@gmail.com wrote: Thanks for all the suggestions! They'll keep me going for a weekend. Roman Perepelitsa. -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Clojure CDT up, cont, down, local-names throws arity errors after hitting breakpoint
Hi All, I'm using Clojure 1.3.0 with CDT 1.2.6.2 on OSX Lion with Java 1.6. I want to set a breakpoint on -main on the program to be debugged. So, run lein repl on this program. It opens up port 8030 successfully. (This is based off the documentation here: http://georgejahad.com/clojure/cdt.html) seans-macaroni-book:gslisp seanneilan$ lein repl Listening for transport dt_socket at address: 8030 REPL started; server listening on localhost port 13575 Then, I start up a new shell in a different project and do this to attach to the program to be debugged: seans-macaroni-book:cdt seanneilan$ lein repl REPL started; server listening on localhost port 57048 user= (use 'cdt.ui) nil user= (cdt-attach 8030) nil user= CDT ready It attaches correctly. Then, I set the breakpoint on -main user= (set-bp gslisp.core/-main) bp set on (#LocationImpl gslisp.core$_main:240) nil Then, in the other shell, I call -main gslisp.core= (-main) which correctly stalls In the debugger shell, I see user= Breakpoint #BreakpointEventImpl breakpointev...@gslisp.core $_main:240 in thread Thread-2 hit CDT location is /Users/seanneilan/BucketsOfNantucket/research/gslisp/ src/gslisp/core.clj:240:0: But, if I try to type any debugging commands, I get this: user= (locals) ArityException Wrong number of args (0) passed to: reval$locals clojure.lang.AFn.throwArity (AFn.java:437) user= (up) ArityException Wrong number of args (0) passed to: ui$up clojure.lang.AFn.throwArity (AFn.java:437) user= (down) ArityException Wrong number of args (0) passed to: ui$down clojure.lang.AFn.throwArity (AFn.java:437) user= (up 1) ArityException Wrong number of args (1) passed to: ui$up clojure.lang.AFn.throwArity (AFn.java:437) user= (up 0 0) IllegalArgumentException No matching field found: frames for class java.lang.Long clojure.lang.Reflector.getInstanceField (Reflector.java:289) user= (print-frames) ArityException Wrong number of args (0) passed to: ui$print-frames clojure.lang.AFn.throwArity (AFn.java:437) user= (cont) CompilerException java.lang.RuntimeException: Unable to resolve symbol: cont in this context, compiling:(NO_SOURCE_PATH:20) So basically the breakpoint hits but I can't run any debugging commands. -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Calling all Melbourne, Australia, Clojure users
Definitely interested, although I'm in Gippsland rather than Melbourne itself so am reasonably restricted in what I can attend in the city during the week. When I get moving I'll join the Meetup list. - DAemon On 07/02/2012, at 10:23 PM, James Sofra james.so...@gmail.com wrote: Hi all, I have been discussing recently possibly starting a Melbourne Clojure meetup. We have a possible location scouted out already but I really don't have a good idea of who may be using Clojure in Melbourne. I met a couple of people at the Conj last year so I am in contact with them and there is this list of people at http://clojure.meetup.com/members/au/melbourne/ If I can find enough interested people I will go ahead and organise something more official but for the moment I am just trying to scout out to see if there is any interest. So please drop a note here, or you email me directly, to let me know if you are in Melbourne and interesting in catching up to chat about and hack Clojure. BTW, anyone had any experience with meetup.com, is it worth paying the dues to use? Cheers, James Sofra -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
noob question on lein and 1.4
So I bought a couple of books on Clojure and one of them tells me to use Lein, the other tells me to download from github. - in lein repl, (clojure-version) gives me '1.2' - in the github d/l'd version, (clojure-version) gives me '1.4' I googled a bit, and when I type 'lein' I don't see anything about upgrading clojures version. How do I upgrade the lein repl version, (and the ancillary question is 'does this actually matter?') Thanks! Ambert -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: mixins/multiple inheritance
Hm, I wrote a reply yesterday figuring it would show up today (seeing as I accidentally double posted last time because it did not show up at once), but that reply seems to be lost. I see what you mean now, I think. Seeing as you will have to build your hierarchies yourself you might try something like the following: (defrecord Label [text]) (defrecord TextField [text]) (defmacro c-mix [orig o-args mixin m-args] `(with-meta (new ~orig ~o-args) {:mixin (new ~mixin ~m-args)})) ;; Extracting the mixin instance (defn mixin [o] (:mixin (meta o))) (defmulti render (fn [x] (or (class (:mixin (meta x))) (class x (defmethod render TextField [x] (:text x)) (defmethod render Label [x] (str (:text (mixin x)) : (render (with-meta x {} (def labelledtextfield (c-mix TextField Foo Label Name)) (def textfield (TextField. Foo)) (render textfield) ;= Foo (render labelledtextfield) ;= Name: Foo This will allow you to emulate dynamic mixin composition by using the c-mix macro which is like a constructor call that attaches an instance of the mixin object as meta data. I know you would like to avoid macros, but since it is not possible to instantiate an object from a function parameter I don't think you can avoid them entirely. Ad-hoc hierarchies using derive might also combine well with this solution, but then you would have to stay away from defrecord and define your own types I think. Regards, Matthias -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Print only by clojure code
Piggy-backing off Mark's answer, if it is log4j that's being used, you can also use log4j.properties to set different logging levels for your Java code vs. your Clojure code (assuming the code are in different packages): http://stackoverflow.com/questions/3569395/filtering-out-log4j-messages-from-third-party-frameworks On Wednesday, February 8, 2012 11:40:45 AM UTC-8, Mark Rathwell wrote: It's logging, and assuming the logging implementation it is using log4j, you can specify the logging properties in a properties file, as system properties, or set the properties in code. The easiest way is to place a file called log4j.properties on the classpath (in the resources directory of your project) containing the following: # set root logger level to OFF (OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE, ALL) log4j.rootLogger=OFF On Wed, Feb 8, 2012 at 1:49 PM, Simone Mosciatti mweb@gmail.com wrote: Hi guys, I have developed a very very little application in clojure that use an external lib in java that i prefer do not touch. The problem is that this lib for some weird reason (debug i guess) print at video a bunch of information useless for me, there is any way to avoid this problem, i mean can i just print what the clojure code actually print and not what also the lib in java print ? I'm sorry for my English... -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Print only by clojure code
Mark Rathwell mark.rathw...@gmail.com writes: It's logging, and assuming the logging implementation it is using log4j, Why do you know that from the information given? Just in case the java lib in fact uses System.out/err directly, one can redirect standard out and error to something else. (with-open [w (clojure.java.io/writer /dev/null)] (binding [*out* w, *err* w] (.noisyJavaCall1 1 2 3) (.noisyJavaCall2 3 2 1))) Of course, /dev/null is somewhat platform specific. Bye, Tassilo -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Print only by clojure code
Tassilo: I don't know it , but it is the most likely probability. One would hope that if a library is dumping to the console, or anywhere, it is done through a standard logging lib configurable by the client. If it turned out not to be the case, it would be evident quickly, and then try other possibilities. Sent from my iPhone On Feb 8, 2012, at 3:15 PM, Tassilo Horn tass...@member.fsf.org wrote: Mark Rathwell mark.rathw...@gmail.com writes: It's logging, and assuming the logging implementation it is using log4j, Why do you know that from the information given? Just in case the java lib in fact uses System.out/err directly, one can redirect standard out and error to something else. (with-open [w (clojure.java.io/writer /dev/null)] (binding [*out* w, *err* w] (.noisyJavaCall1 1 2 3) (.noisyJavaCall2 3 2 1))) Of course, /dev/null is somewhat platform specific. Bye, Tassilo -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: noob question on lein and 1.4
Ambert Ho amber...@gmail.com writes: So I bought a couple of books on Clojure and one of them tells me to use Lein, the other tells me to download from github. - in lein repl, (clojure-version) gives me '1.2' - in the github d/l'd version, (clojure-version) gives me '1.4' I googled a bit, and when I type 'lein' I don't see anything about upgrading clojures version. If you run inside a project (generated with lein new) then it will use whatever version of Clojure the project specifies. You can't change the version of lein repl outside a project though; it has to use whatever version Leiningen uses. Leiningen is mostly centered around project automation, so mostly you work inside the context of projects. -Phil -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: No show?
clojure.reflect/reflect gets you the same information as a big 'ole data structure. You can pprint it for readability. The only thing that was not ported was the formatted text output, which would be easy enough to reproduce based on `reflect`. -S -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Transactional Synchronization in Haswell
Interesting. Thanks for the good answer. I totally forgot the JVM layer adjustments first ;-) Best Stefan E. -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: mixins/multiple inheritance
Is there a reason not to just use protocols for your mixins? (defprotocol Labelled whatever) (defprotocol Textfield whatever-else) (defprotocol Datetimepicker something) (defrecord Label Labelled whatever ...) (defrecord Textbox Textfield whatever-else ...) (defrecord LabelledTextbox Labelled whatever ... Textfield whatever-else ...) and so forth, and probably punt to external fns for anything that would otherwise get duplicated between Textbox and LabelledTextbox, or between Label and LabelledTextbox, and so forth. -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Print only by clojure code
On Wed, Feb 8, 2012 at 3:15 PM, Tassilo Horn tass...@member.fsf.org wrote: Mark Rathwell mark.rathw...@gmail.com writes: It's logging, and assuming the logging implementation it is using log4j, Why do you know that from the information given? Just in case the java lib in fact uses System.out/err directly, one can redirect standard out and error to something else. (with-open [w (clojure.java.io/writer /dev/null)] (binding [*out* w, *err* w] (.noisyJavaCall1 1 2 3) (.noisyJavaCall2 3 2 1))) Of course, /dev/null is somewhat platform specific. Will that work? I was under the impession that binding *out* and *err* had no effect on System/out or System/err. The OP may wish to use System/setOut and/or System/setErr instead of binding. -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Clojurescript options :foreign-libs (and an idea seeking opinions)
I think that the use of :foreign-libs to include non closure js libs in cljs builds may be hazardous My reasoning as as follows: if you use :foreign-libs, you create a namespace for the library - and must require this namespace in order for it to be included in the build. But, if you plan to use advanced compilation and use :externs this namespace is never provided. The result is that switching for simple to advance compilation requires a change in every file that required the dependency - to remove it. Probably not a huge issue - but not ideal either. --- Following on from this I have an Idea for browser targeted foreign js libs and I would like input/opinions suppose a macro (wrap-js js-file externs-file options (foo [] (.foo js/SomeClass) ) to be used something like: (ns my-wrapper) (wrap-js some.js some.externs.js {:inline true} ...fn definitions... ) this will then: 1. ensure that the externs file is included in the build. 2. generate a function that is called in the client when bootstrap.js is loaded to insert a script tag in the head of the page, loading or inlining the raw js There would probably be need to ensure that the script is read before fns can be called. Feasible? Cheers Dave -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Suggestions for using MPI in Clojure
From what I've seen, MPI in java is not good performance wise. You take a huge hit due to all the copying. To get good cluster performance in java, you need to use something like Java Fast Sockets. http://developers.sun.com/solaris/articles/fastSockets.html http://www.des.udc.es/~juan/papers/comcom.pdf MPJ looks promising, but I honestly have never tried it. I'd be interested in seeing how far that takes you. Best, Brent -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Calling all Melbourne, Australia, Clojure users
On 7 February 2012 22:23, James Sofra james.so...@gmail.com wrote: So please drop a note here, or you email me directly, to let me know if you are in Melbourne and interesting in catching up to chat about and hack Clojure. I'd be 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure CDT up, cont, down, local-names throws arity errors after hitting breakpoint
Sorry about that. As you noticed the doc here was out of date: http://georgejahad.com/clojure/cdt.html It should be fixed now. Just for your reference however that doc only describes the command line version of CDT. If you use Emacs and Swank-clojure, it is much easier to use swank-cdt, as your UI: http://georgejahad.com/clojure/swank-cdt.html On Feb 8, 11:11 am, Sean Neilan sneil...@gmail.com wrote: Hi All, I'm using Clojure 1.3.0 with CDT 1.2.6.2 on OSX Lion with Java 1.6. I want to set a breakpoint on -main on the program to be debugged. So, run lein repl on this program. It opens up port 8030 successfully. (This is based off the documentation here:http://georgejahad.com/clojure/cdt.html) seans-macaroni-book:gslisp seanneilan$ lein repl Listening for transport dt_socket at address: 8030 REPL started; server listening on localhost port 13575 Then, I start up a new shell in a different project and do this to attach to the program to be debugged: seans-macaroni-book:cdt seanneilan$ lein repl REPL started; server listening on localhost port 57048 user= (use 'cdt.ui) nil user= (cdt-attach 8030) nil user= CDT ready It attaches correctly. Then, I set the breakpoint on -main user= (set-bp gslisp.core/-main) bp set on (#LocationImpl gslisp.core$_main:240) nil Then, in the other shell, I call -main gslisp.core= (-main) which correctly stalls In the debugger shell, I see user= Breakpoint #BreakpointEventImpl breakpointev...@gslisp.core $_main:240 in thread Thread-2 hit CDT location is /Users/seanneilan/BucketsOfNantucket/research/gslisp/ src/gslisp/core.clj:240:0: But, if I try to type any debugging commands, I get this: user= (locals) ArityException Wrong number of args (0) passed to: reval$locals clojure.lang.AFn.throwArity (AFn.java:437) user= (up) ArityException Wrong number of args (0) passed to: ui$up clojure.lang.AFn.throwArity (AFn.java:437) user= (down) ArityException Wrong number of args (0) passed to: ui$down clojure.lang.AFn.throwArity (AFn.java:437) user= (up 1) ArityException Wrong number of args (1) passed to: ui$up clojure.lang.AFn.throwArity (AFn.java:437) user= (up 0 0) IllegalArgumentException No matching field found: frames for class java.lang.Long clojure.lang.Reflector.getInstanceField (Reflector.java:289) user= (print-frames) ArityException Wrong number of args (0) passed to: ui$print-frames clojure.lang.AFn.throwArity (AFn.java:437) user= (cont) CompilerException java.lang.RuntimeException: Unable to resolve symbol: cont in this context, compiling:(NO_SOURCE_PATH:20) So basically the breakpoint hits but I can't run any debugging commands. -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure CDT up, cont, down, local-names throws arity errors after hitting breakpoint
forgot to mention that Hugo Duncan is also working on a debugger which can be found here: https://github.com/pallet/ritz On Feb 8, 10:16 pm, George Jahad cloj...@blackbirdsystems.net wrote: Sorry about that. As you noticed the doc here was out of date: http://georgejahad.com/clojure/cdt.html It should be fixed now. Just for your reference however that doc only describes the command line version of CDT. If you use Emacs and Swank-clojure, it is much easier to use swank-cdt, as your UI: http://georgejahad.com/clojure/swank-cdt.html On Feb 8, 11:11 am, Sean Neilan sneil...@gmail.com wrote: Hi All, I'm using Clojure 1.3.0 with CDT 1.2.6.2 on OSX Lion with Java 1.6. I want to set a breakpoint on -main on the program to be debugged. So, run lein repl on this program. It opens up port 8030 successfully. (This is based off the documentation here:http://georgejahad.com/clojure/cdt.html) seans-macaroni-book:gslisp seanneilan$ lein repl Listening for transport dt_socket at address: 8030 REPL started; server listening on localhost port 13575 Then, I start up a new shell in a different project and do this to attach to the program to be debugged: seans-macaroni-book:cdt seanneilan$ lein repl REPL started; server listening on localhost port 57048 user= (use 'cdt.ui) nil user= (cdt-attach 8030) nil user= CDT ready It attaches correctly. Then, I set the breakpoint on -main user= (set-bp gslisp.core/-main) bp set on (#LocationImpl gslisp.core$_main:240) nil Then, in the other shell, I call -main gslisp.core= (-main) which correctly stalls In the debugger shell, I see user= Breakpoint #BreakpointEventImpl breakpointev...@gslisp.core $_main:240 in thread Thread-2 hit CDT location is /Users/seanneilan/BucketsOfNantucket/research/gslisp/ src/gslisp/core.clj:240:0: But, if I try to type any debugging commands, I get this: user= (locals) ArityException Wrong number of args (0) passed to: reval$locals clojure.lang.AFn.throwArity (AFn.java:437) user= (up) ArityException Wrong number of args (0) passed to: ui$up clojure.lang.AFn.throwArity (AFn.java:437) user= (down) ArityException Wrong number of args (0) passed to: ui$down clojure.lang.AFn.throwArity (AFn.java:437) user= (up 1) ArityException Wrong number of args (1) passed to: ui$up clojure.lang.AFn.throwArity (AFn.java:437) user= (up 0 0) IllegalArgumentException No matching field found: frames for class java.lang.Long clojure.lang.Reflector.getInstanceField (Reflector.java:289) user= (print-frames) ArityException Wrong number of args (0) passed to: ui$print-frames clojure.lang.AFn.throwArity (AFn.java:437) user= (cont) CompilerException java.lang.RuntimeException: Unable to resolve symbol: cont in this context, compiling:(NO_SOURCE_PATH:20) So basically the breakpoint hits but I can't run any debugging commands. -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: mixins/multiple inheritance
Cedric's is the approach I would take. Like he said, use private functions for the shared code. On Wed, Feb 8, 2012 at 8:49 PM, Cedric Greevey cgree...@gmail.com wrote: Is there a reason not to just use protocols for your mixins? (defprotocol Labelled whatever) (defprotocol Textfield whatever-else) (defprotocol Datetimepicker something) (defrecord Label Labelled whatever ...) (defrecord Textbox Textfield whatever-else ...) (defrecord LabelledTextbox Labelled whatever ... Textfield whatever-else ...) and so forth, and probably punt to external fns for anything that would otherwise get duplicated between Textbox and LabelledTextbox, or between Label and LabelledTextbox, and so forth. -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojurescript options :foreign-libs (and an idea seeking opinions)
Having read through some of the closure compiler code - I don't think that inserting the externs file into the build is possible - without changes to the compiler. I do think that support for wrapping foreign libs into a usable unit would be a good idea. D -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Print only by clojure code
Cedric Greevey cgree...@gmail.com writes: Hi Cedric, Just in case the java lib in fact uses System.out/err directly, one can redirect standard out and error to something else. (with-open [w (clojure.java.io/writer /dev/null)] (binding [*out* w, *err* w] (.noisyJavaCall1 1 2 3) (.noisyJavaCall2 3 2 1))) Of course, /dev/null is somewhat platform specific. Will that work? I was under the impession that binding *out* and *err* had no effect on System/out or System/err. No, it won't work. I tested it briefly in a slime repl and forgot the fact that java sysouts aren't printed in there anyway. So using your setOut/Err() advice, here's a java quitening macro that actually works: --8---cut here---start-8--- (defmacro without-java-output [ body] `(with-open [w# (java.io.PrintStream. /dev/null)] (let [oo# System/out, oe# System/err] (System/setOut w#) (System/setErr w#) (try ~@body (finally (System/setOut oo#) (System/setErr oe#)) (without-java-output (.println System/out Hello out) (.println System/err Hello err)) --8---cut here---end---8--- Bye, Tassilo -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en