Re: Clojure + Java Interop + Gnome Interop -- KeyPressEvent fails

2011-12-05 Thread Rett Kent
On 12/03/2011 10:16 AM, Henrik Lundahl wrote: Hi Rett There is no such type as org.gnome.gtk.Window$__KeyPressEvents, at least not in 4.1 of the Java Gnome API http://java-gnome.sourceforge.net/doc/api/4.1/org/gnome/gtk/Window.html. org.gnome.gtk.Window$__KeyPressEvent exists though. I'd

Clojure + Java Interop + Gnome Interop -- KeyPressEvent fails

2011-12-02 Thread Rett Kent
So, I've been dipping my toe in the waters of Clojure UI development using Gnome, and I immediately ran in into a problem making me regret my years of Java apathy. I'm trying to write a toy program to processes generic key presses made to the Gnome window and I'm stuck as to how to translate

Newbie help in pitching in

2011-10-19 Thread Rett Kent
Hi all, Now that I have my shiny new, clojure-dev membership, I'd like to pitch in. I took a look at the pages describing how to contribute. http://clojure.org/contributing http://clojure.org/patches The process for contributing is pretty clear, but I'm finding it hard to find anything

Re: dynamically generated let bindings

2011-07-28 Thread Kent
the binding-vec function as an argument. (defn mdbf [form binding-func] (fn [ args] (eval `(let ~(binding-func args) ~form Here it is used in your example. (defn binding-vec [args] ['size (count args)] (def a (mdbf '(+ size 10) binding-vec)) (a 1 2 3 4) = 14 Kent. On Jul 28, 3:48 pm

Re: Help to optimize palindrome search from input file

2010-10-20 Thread Kent
and then grow the palindrome out from that seed until it looses its palindromness. Kent. (def st

Re: Generating functions programmatically

2010-09-11 Thread Kent
[kwd] (let [fn-name (symbol (str prefix- (name kwd)))] (intern *ns* fn-name (make-fn kwd Kent -- 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

Re: Clojure macros

2010-09-05 Thread Kent
When clojure evaluates a piece of code it goes through several steps. First the reader takes the string representation of your code and turns it into the clojure data structures represented by your code. Those data structures are then sent to the compiler for compilation, including possible macro

order of returned values from keys and vals

2010-08-11 Thread Kent
it documented anywhere and I don't want to write a bunch of code that assumes it will work and then have that code break in the future. Thanks. Kent -- 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

Re: Looking to fit Clojure into my architecture and am in need of your informed advice!

2010-08-02 Thread Kent Larsson
code out on it too. I'll let my experimentation phase drag on for a while. Until I get an architecture which I believe in. And is fun. :-) (for my motivation.) Thanks again for helping out! If anyone has any more tips I'll all eyes! Best regards, Kent On Mon, Aug 2, 2010 at 10:20, nickikt nick

Looking to fit Clojure into my architecture and am in need of your informed advice!

2010-08-01 Thread Kent Larsson
you have about this? Thank you SO MUCH for reading this rather long mail! I appreciate it and would really love if you have some feedback for me! Best regards, Kent Larsson -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send

Re: Interface to integrate transactions with Clojure transactions

2010-06-11 Thread Chris Kent
Somebody on this list started an actual implementation of such an integration a couple of months ago. Try searching through the group's archive for terms like TransactionManager, or something very similar. Unfortunately my Java-fu is lacking enough for me not to remember the exact interface

introspecting types and records

2010-06-07 Thread Chris Kent
Hi Is there a way to introspect types defined with deftype and defrecord? I'd just like to know the field names and their order in the constructor. Java reflection works fine but requires some fiddling around to filter the static fields and __meta and __extmap. It feels like something that

Re: Class of a wicket page

2010-01-27 Thread Chris Kent
I think the problem is that cwicket.HomePage resolves to a class object (like cwicket.HomePage.class in Java).  So (class cwicket.HomePage) returns the class of the class object which is java.lang.Class.  And that's not a subclass of Wicket's WebPage.  Try this:   (defn -getHomePage [this]

Re: function to perform operations on adjacent values

2010-01-21 Thread Chris Kent
partition creates a sequence of sequences of adjacent values user= (partition 2 (range 1 7)) ((1 2) (3 4) (5 6)) and you can apply reduce to each of the sequences using map user= (map #(reduce + %) (partition 2 (range 1 7))) (3 7 11) or user= (map (partial reduce + ) (partition 2 (range 1

Re: Datatypes and protocols - update

2009-12-11 Thread Chris Kent
Rich Hickey richhickey at gmail.com writes: An updated version of the code for datatypes[1] and protocols[2] is now available in the 'new' branch[3]. I've converted some code that used gen-class to use deftype and defprotocol and the results are great so far. The code is shorter, easier to

Re: Remote REPL problem when connecting to RMI Client VM

2009-11-17 Thread Kent
to dynamically add clojure.jar to the classpath at runtime using add-classpath. It seems unlikely, but worth a shot. Any other ideas? Thanks. Kent. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Remote REPL problem when connecting to RMI Client VM

2009-11-16 Thread Kent
. If enter (str kent) I get java.lang.NoClassDefFoundError: clojure/lang/ AFunction. Most things I enter produce something similar. I can however do a simple def such as (def x 3) and x does get defined so the REPL does seem to be running in some sense. It seems like it might be a classpath problem

Re: Datatypes and Protocols - early experience program

2009-11-13 Thread Chris Kent
Mark Engelberg mark.engelberg at gmail.com writes: I'm a little worried about the strong overlap between reify/proxy, deftype/defstruct, and defclass/gen-class. I can just imagine the questions a year from now when people join the Clojure community and want to understand how they differ. So

Re: dynamic :use

2009-09-08 Thread Chris Kent
James Sofra james.sofra at gmail.com writes: I know that this has come up before on the group and but is this not essentially dependency injection where the dependency being injected is a name space that presumably follows a particular convention in terms of what functions it provides?

Re: Keyword not serializable

2009-07-31 Thread Chris Kent
benefits, specifically that a proper patch would ensure that deserialized Keywords are interned as one would expect out. So, I may make a run at this sooner rather than later... - Chas On Jul 24, 7:06 pm, Chris Kent cjk...@gmail.com wrote: Hi Are there any fundamental reasons why

Re: REQUEST: Add seqable? to core

2009-07-29 Thread Chris Kent
I was thinking exactly the same thing. It feels like there should be a better way than instance? ...Sequable. Unless there's a reason that's a bad idea. Chris On Jul 27, 6:49 pm, Sean Devlin francoisdev...@gmail.com wrote: Rich, There have been a few times in this thread that people have

Keyword not serializable

2009-07-24 Thread Chris Kent
Hi Are there any fundamental reasons why the Keyword class shouldn't be serializable? I've been playing around with Clojure and Wicket and it's not possible to use maps containing Keywords in Wicket page classes. Wicket pages are serialized and stored in the session between requests and this

Re: surprising behaviour with do, ns and def

2009-07-14 Thread Chris Kent
the.stuart.sie...@gmail.com wrote: On Jul 13, 3:58 pm, Chris Kent cjk...@gmail.com wrote: user= (ns a) (def foo foo) a= #'a/foo a= If the same code is executed inside a do form the var is defined in the original namespace.  I thought that the do should make no difference.  Is this the intended

surprising behaviour with do, ns and def

2009-07-13 Thread Chris Kent
I've noticed that changing namespace with ns and then doing a def doesn't behave the same inside a do form: Without the do form it works as expected: user= (ns a) (def foo foo) nil a= #'a/foo a= If the same code is executed inside a do form the var is defined in the original namespace. I

find returns symbol keys without their metadata

2008-12-18 Thread Chris Kent
Hi I've been playing around using symbols with metadata as struct map keys after reading this message: http://groups.google.com/group/clojure/msg/68e7036dbd8ded29 It all works OK except when you use find to extract an entry. find returns an entry containing the key passed to it, not the key