sharing multiple jogl opengl contexts in clojure

2010-04-19 Thread strattonbrazil
Has anyone done any work sharing OpenGL contexts in Clojure? I was wondering the best way to create a GLCanvas if I want all of them to share the same context. Right now it seems calling (.getContext (new GLCanvas)) returns nil, which may be a JOGL thing, but I was hoping to create one canvas

matching symbols in a dictionary

2010-04-13 Thread strattonbrazil
I want to map a dictionary and do different things depending on the key. I was planning on using an if-clause, but I'm not sure how to compare symbols to strings. Something like (map (fn [k v] (if (== k hello) ... ...) {:hello 1 :goodbye 2}) How would I normally compare symbols and strings?

mutating multiple java swing components

2010-04-08 Thread strattonbrazil
What's the function to call java code on multiple java components? If I have a sequence of Java swing components and I want to go through and set the same properties for each one, I would use a for loop in Java. If I were using immutable structs in clojure, I'd just a map and just change the

holding types or units in metadata vs pattern matching

2010-04-02 Thread strattonbrazil
What's the best way to keep track of what kind of value something is? For example, if I have a hash of floats and I want to go through each one and see if a given key-value, which happens to be a float, if it's a distance or a frequency? Or if something is a struct or a specific struct? I'm

intuitive stack trace

2010-03-29 Thread strattonbrazil
In the relatively short time of using clojure, I'm a little frustrated with it's limited information the stack provides. I'm assuming there's something I just don't know or am not doing. Many times when I do something wrong, I have to read through the stack which sometimes just says there's an

copying structures

2010-03-28 Thread strattonbrazil
This may be really basic. So much so that it's hard to find on the internet, but is there something like a copy constructor in clojure, where I can copy everything in a structure except one or two keys? Maybe something like struct-map, but fills in the other variables not supplied by another data

Re: copying structures

2010-03-28 Thread strattonbrazil
Is this the common way to do it? (def sister (assoc brother :name Cindy)) Reading up more on structs, it seems they have base keys that can't be dissoc. Is that the main difference then between it and a hash? On Mar 28, 2:48 pm, strattonbrazil strattonbra...@gmail.com wrote: I did a poor job

referencing an atom inside a function used for swapping

2010-03-25 Thread strattonbrazil
I have a function that I use for adding a JPanel to a ui atom. When I call swap! that ui atom is sent to that function I call with the swap! on and is dereferenced inside the function so I don't need to call @ui on it. However, I want to add listeners to my JPanel that can affect that atom, but

Re: clojure naming convention for accessors vs. local variables

2010-03-20 Thread strattonbrazil
with an uppercase first letter works, and isn't too uncommon; besides this is a special-case performance issue, right? On Mar 19, 4:36 pm, strattonbrazil strattonbra...@gmail.com wrote: If am creating accessors to access structures, how should they be named? (defstruct employer :employee

clojure naming convention for accessors vs. local variables

2010-03-19 Thread strattonbrazil
If am creating accessors to access structures, how should they be named? (defstruct employer :employee) (defstruct employee :employer) (def employee-name (accessor employee :employer)) (def employer-name (accessor employer :employee)) In a situation where one struct is pointing to the other, is

Re: jogl classpath not found

2010-03-12 Thread strattonbrazil
-amd64/lib/ nativewindow.all.jar clojure.main test.lsp On Mar 12, 8:20 am, Michał Marczyk michal.marc...@gmail.com wrote: On 12 March 2010 17:09, strattonbrazil strattonbra...@gmail.com wrote: java -cp -Djava.library.path=./jogl-2.0-linux-amd64/lib ~/clojure/ clojure-1.0.0.jar:./jogl-2.0-linux

Re: jogl classpath not found

2010-03-11 Thread strattonbrazil
on that should work for you. On Mar 11, 1:28 pm, strattonbrazil strattonbra...@gmail.com wrote: I downloaded the new jogl 2.0 libs and can't get jogl to be recognized in my classpath.  It's stuck on the import. (import '(javax.media.opengl.awt GLCanvas)) In my shell I have clojure aliased

Re: enclojure install killed netbeans 6.8

2010-03-10 Thread strattonbrazil
: On Sun, Mar 7, 2010 at 6:44 PM, strattonbrazil strattonbra...@gmail.com wrote: I am on Linux.  I have a 6.6 and a 6.8 directory in my .netbeans folder.  6.6 still runs.  I have tried moving individual jars in and out of that dir, but I still get the error.  I even moved the entire 6.8 dir

Re: enclojure install killed netbeans 6.8

2010-03-08 Thread strattonbrazil
wrote: On Fri, Mar 5, 2010 at 11:34 PM, strattonbrazil strattonbra...@gmail.com wrote: Has anyone had problems with netbeans starting with the enclojure alpha?  I restarted my session and it died.  Now when I try to run netbeans, it throws a classpath exception.  Can I remove this plugin

enclojure install killed netbeans 6.8

2010-03-06 Thread strattonbrazil
Has anyone had problems with netbeans starting with the enclojure alpha? I restarted my session and it died. Now when I try to run netbeans, it throws a classpath exception. Can I remove this plugin or am I missing something in my install? Exception in thread main

mutable half-edge data structures to immutable languages

2010-03-04 Thread strattonbrazil
I have implemented the half-edge data structure several times now for mesh representation. Basically there are three main data structures (vertex, edge, face). I'll explain them a bit, but I think this is a more functional programming/Clojure question than actual geometry. A vertex is a corner

appropriate uses of clojure

2010-02-22 Thread strattonbrazil
Object-oriented design has been frequently sourced as becoming standard for simulations. Even on the clojure website, it states, [Object-oriented design is ] Born of simulation, now used for everything, even when inappropriate. I've also heard GUIs are more easily developed using object