Re: Weird nested macro problem

2011-02-02 Thread Meikel Brandmeyer
Hi, On 2 Feb., 08:44, Ken Wesson kwess...@gmail.com wrote: This also means that macros should not use list? to test whether an object is a nonatomic s-expression. Unfortunately core doesn't contain a compact test for atomicity; to get all the list-y things that print as (foo bar baz ...) you

Re: AOP in Clojure

2011-02-02 Thread Shantanu Kumar
I think what a Ring middleware[1] does might be very close what you want to do with AOP. Clojure has a natural way to decorate an existing body of code using higher order functions and macros. [1] http://github.com/mmcgrana/ring Could you share some use cases that you want to achieve with AOP?

Re: AOP in Clojure

2011-02-02 Thread Saul Hazledine
On Feb 2, 2:09 pm, Nebojsa Stricevic nebojsa.strice...@gmail.com wrote: Hi, Are there any general purpose libraries/frameworks with nice API/DSL for Aspect Oriented Programming for Clojure? Or is there someone working on it? Is it needed? Possible? I agree with Shantanu and feel that Ring

java.io.IOException with compile

2011-02-02 Thread K.
Hello, What's wrong with this example? $ cat testlongname/editor/controller/listeners/ swing_test_listeners.clj (ns testlongname.editor.controller.listeners.swing-test-listeners (:use clojure.contrib.monads)) (defn some-long-function-name-abdefghijklmnopqrstuvxwyz-

Re: java.io.IOException with compile

2011-02-02 Thread Meikel Brandmeyer
Hi, I'll just throw a wild guess into the room and say that your filename hits the filename limit imposed by the file system of your system. Sincerely Meikel -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: how to print-dup records?

2011-02-02 Thread Seth
Ive just thought up that using print-dup for records might become a nightmare. This is because it will now matter which ns you load it from. If it loads an ns where the constructor function isnt defined or isnt imported, it will throw an error. This will become a nightmare when mixes records from

Re: how to print-dup records?

2011-02-02 Thread Meikel Brandmeyer
Hi, why don't you just fully qualify the constructor function? Works from everywhere. Sincerely Meikel -- 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

Re: Weird nested macro problem

2011-02-02 Thread Straszheim, Jeff
Thanks. That is indeed what fixed it! And macroexpand (and pr in general) should have an option to mark what is a list and what is a cons thingy. That is confusing. On Feb 2, 2011, at 1:48 AM, George Jahad wrote: As usual, Meikel has the right answer. But I didn't quite get it at first.

Re: a handy little function I haven't seen before

2011-02-02 Thread Miki
FYI: There is clojure.contrib.repl-utils/show -- 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

java interop question

2011-02-02 Thread clwham...@gmail.com
I am doing some prototyping with the event processing framework Esper (http://esper.codehaus.org/) and I'm running up against my ignorance of clojure/java interop. I would like to create a java bean in clojure that is visible to the Esper runtime; I found some sample Java code that I clojurized as

Re: java.io.IOException with compile

2011-02-02 Thread Armando Blancas
You surely mean that swing_test_listeners $some_long_function_xyx_.class is too long. On Feb 2, 6:51 am, Meikel Brandmeyer m...@kotka.de wrote: Hi, I'll just throw a wild guess into the room and say that your filename hits the filename limit imposed by the file system of your system.

Re: a handy little function I haven't seen before

2011-02-02 Thread George Jahad
show's a very cool function, but has a different purpose, (afaik). It displays the structure of an instance, but not it's contents. get- all-fields displays the contents. For example, if a is defined like so: (def a (partial conj [98])) get-all-fields will show me that the parameters to

Re: java.io.IOException with compile

2011-02-02 Thread Meikel Brandmeyer
Hi, Am 02.02.2011 um 17:30 schrieb Armando Blancas: You surely mean that swing_test_listeners $some_long_function_xyx_.class is too long. Yes. This is what I implied. Sincerely Meikel -- You received this message because you are subscribed to the Google Groups Clojure group. To post to

Re: a handy little function I haven't seen before

2011-02-02 Thread Dan Larkin
George this is super cool! I can't wait to see this show up in swank-clojure *ahem* Phil. On Feb 2, 2011, at 12:03 PM, George Jahad wrote: show's a very cool function, but has a different purpose, (afaik). It displays the structure of an instance, but not it's contents. get-

Re: Weird nested macro problem

2011-02-02 Thread Ken Wesson
On Wed, Feb 2, 2011 at 3:22 AM, Meikel Brandmeyer m...@kotka.de wrote: Hi, On 2 Feb., 08:44, Ken Wesson kwess...@gmail.com wrote: This also means that macros should not use list? to test whether an object is a nonatomic s-expression. Unfortunately core doesn't contain a compact test for

Re: a handy little function I haven't seen before

2011-02-02 Thread George Jahad
Actually, you should thank hiredman, for adding the original wall-hack- field. I just wrapped some lipstick around it. On Feb 2, 9:40 am, Dan Larkin d...@danlarkin.org wrote: George this is super cool!  I can't wait to see this show up in swank-clojure *ahem* Phil. On Feb 2, 2011, at 12:03

Deflayout - define Swing UI declaratively

2011-02-02 Thread Alexander Yakushev
Since defining the UI in Clojure is pretty tedious process, even with all nice interop features, I decided to write a small library to do this more easily and in a declarative way. I was inspired by a series of blogposts by Stuart Sierra, he wrote a wonderful macro that deals with GridBagLayout.

Re: AOP in Clojure

2011-02-02 Thread Nebojsa Stricevic
Thanks for these answers. I forgot about Robert Hooke, although I've seen it already. I don't have a real use case yet. I'm researching Domain Specific Languages composition/combining, so AOP could be useful. I've checked some Clojure tracing code, I'll dig into Ring more and Robert Hooke looks

extend-protocol with defrecord

2011-02-02 Thread Michael Ossareh
Hi All, I've found extending-protocol to hold on to a references to records when they're redefined. example (defprotocol ToExtend (foo [this])) ToExtend example (defrecord Extender1 []) example.Extender1 example (extend-protocol ToExtend Extender1 (foo [this] extender1)) nil example

Re: extend-protocol with defrecord

2011-02-02 Thread Alex Osborne
Michael Ossareh ossa...@gmail.com writes: You'll notice in the map returned after the second (extend-protocol) that :impls has example.Extender1 listed twice. I assume this is because they're different records, though the fact that they share the same name is confusing (hence the example of

Re: Helper functions for accessing properties in clojure-clr 1.2.0

2011-02-02 Thread Matthew D. Swank
On Feb 1, 6:10 pm, Matthew D. Swank akopa.gmane.pos...@gmail.com wrote: AFAIK clojure-clr doesn't have built-in support for accessing properties.   Ok David Miller let me know off list the existing interop handle properties. -- You received this message because you are subscribed to the

Re: extend-protocol with defrecord

2011-02-02 Thread Michael Ossareh
On Wed, Feb 2, 2011 at 18:49, Alex Osborne a...@meshy.org wrote: Michael Ossareh ossa...@gmail.com writes: You'll notice in the map returned after the second (extend-protocol) that :impls has example.Extender1 listed twice. I assume this is because they're different records, though the

Re: Helper functions for accessing properties in clojure-clr 1.2.0

2011-02-02 Thread dmiller
Specifically, in ClojureCLR property access in CLR interop is treated in the same way as fields and zero-arity methods. For class properties, ClassName/PropertyName works. For instance properties, (.PropertyName instance) or (. instance PropertyName) In essence, fields, properties and

ClojureCLR: change in naming/location of AOT-compiled assemblies

2011-02-02 Thread dmiller
I've made a change to the naming and location of AOT-compiled assemblies generated by ClojureCLR. Previously, ClojureCLR had followed the conventions of ClojureJVM in naming/locating class files (assemblies in CLR-land) generated by AOT- compilation. Thus, doing (compile 'a.b.c) would find

Anyone want to take a crack at making the fasta shootout program faster?

2011-02-02 Thread Andy Fingerhut
I've done a pass through most of the Clojure programs on the shootout web site recently, making some of them faster, and choosing -Xmx command line arguments when running them to keep the memory usage down to a reasonable level -- not always the smallest heap size that works, mind you --

Why take-last of empty collection is nil?

2011-02-02 Thread Petr Gladkikh
Should not it be empty colection instead? It seems odd to me since it is inconsistent and forces to consider one more case (nil or collection). And another question. I have written this function (defn index-by Make map (f x) - x [f coll] (reduce #(assoc %1 (f %2) %2) {} coll)) I wonder, is

Re: Why take-last of empty collection is nil?

2011-02-02 Thread Meikel Brandmeyer
Hi, On 3 Feb., 08:04, Petr Gladkikh petrg...@gmail.com wrote: Should not it be empty colection instead? It seems odd to me since it is inconsistent and forces to consider one more case (nil or collection). It is consistent. There is a difference between () and nil. () is the empty list.

Re: Deflayout - define Swing UI declaratively

2011-02-02 Thread Saul Hazledine
On Feb 2, 7:43 pm, Alexander Yakushev yakushev.a...@gmail.com wrote: Usage of the lib is very easy. Here is an example from my tetris game: (deflayout     frame (:border)     :WEST gamepanel     :EAST (deflayout                 sidepanel (:flow :TRAILING)                 nextpanel        

Re: Why take-last of empty collection is nil?

2011-02-02 Thread Ken Wesson
On Thu, Feb 3, 2011 at 2:31 AM, Meikel Brandmeyer m...@kotka.de wrote: Hi, On 3 Feb., 08:04, Petr Gladkikh petrg...@gmail.com wrote: Should not it be empty colection instead? It seems odd to me since it is inconsistent and forces to consider one more case (nil or collection). It is