Re: porting an old project - where to begin?

2011-06-04 Thread MiltondSilva
This, https://github.com/CharlesStain/clj3D , is probably what you are looking for. Though I'm not sure how the inputs are handled. Penumbra ( https://github.com/ztellman/penumbra ) is a very powerful abstraction over opengl and to it's very easy to handle inputs. On Jun 4, 8:24 am, Daniel wrote

Re: Who's using Clojure?

2011-04-19 Thread MiltondSilva
I think that these (http://clojure.org/funders) companies use clojure. On Apr 19, 3:38 pm, Damien Lepage wrote: > Hi Everyone, > > I'm on a mission: introducing Clojure in my company, which is a big > consulting company like many others. > > I started talking about Clojure to my manager yesterday

Re: Testing if a sequence is lazy

2011-01-18 Thread MiltondSilva
Testing for laziness seems simple: (defn lazy? [coll] (= (type coll) clojure.lang.LazySeq)) "For instance if you know a particular sequence could be particularly large or expensive in certain situations, you may want your tests to assert that it is not getting evaluated prematurely.." That's wh

Re: Clojure lambda funcs and bindings

2011-01-18 Thread MiltondSilva
t! or compare-and-set! This page has more explanations/examples http://clojure.org/atoms Hope that helps On Jan 18, 11:37 am, MiltondSilva wrote: > Not sure if I understand your question/problem but, this: > > "How can I avoid the binding of changeling to the initial value of the

Re: Clojure lambda funcs and bindings

2011-01-18 Thread MiltondSilva
Not sure if I understand your question/problem but, this: "How can I avoid the binding of changeling to the initial value of the atom and have the anonymous function passed to map use the current (possibly changed) value of changeling? " You are binding a reference not the actual value of the ato

Re: Quick question about str/join....

2011-01-04 Thread MiltondSilva
Again from inspection it seems the way it's implemented in contrib, the code makes one pass. With (apply str (interpose sep coll)) you make two, one to interpose the other to convert (seq->str). On Jan 5, 1:08 am, John Szakmeister wrote: > On Tue, Jan 4, 2011 at 8:01 PM, MiltondS

Re: Quick question about str/join....

2011-01-04 Thread MiltondSilva
I believe it's for performance reasons. Strings in java are immutable, so they use the StringBuilder(mutable) to achieve better performance. On Jan 5, 12:18 am, John Szakmeister wrote: > I was looking at a commit that updated a docstring for str/join, which > enticed me to take a look at the impl

Re: Funding 2011?

2011-01-04 Thread MiltondSilva
Why must many pay for some? I'm certain that of all the contributions you had, there are only an handful of people who don't understand what a donation is. So with that in mind what is the rational for this kind of action? I mean, you never said that if we donated you would implement our ideas rig

Proxy

2010-02-21 Thread MiltondSilva
The code: (def app (proxy [SimpleApplication] [] (simpleInitApp [] (.attachChild (.getRoot this) ball-d) (.setLocalTranslation ground-d (com.g3d.math.Vector3f. 0 0 0)) (.attachChild (.getRoot this) ground-d)) (si

Re: refs, agents and add-watch

2010-02-12 Thread MiltondSilva
@all: Thank you very much for the replies. My bottomless pit of ignorance must be quite annoying but, I can only hope one day to be in your position. (e.g. answering others questions) @ataggart: A different entity is supposed to change the refs when they go over/under some limit. It's just the way

Re: refs, agents and add-watch

2010-02-11 Thread MiltondSilva
I now have another problem. When I run this in the repl: (add-watch products :prodkey send-products) (add-watch material :matkey ask-material) (dump material products products-store) (loop [cnt 10] (map #(send % client-act) clients) (map #(send % manufacture) artisans) (if (zero? cnt

Re: refs, agents and add-watch

2010-02-11 Thread MiltondSilva
I'm using counterclockwise, clojure version 1.1.0. The exception stopped occurring I think I had to recompile the code. I structured the code this way because of the way the problem is formulated (e.g. the owner should be the only one to inc materials etc), yet, the more I look at it the more it s

Re: refs, agents and add-watch

2010-02-10 Thread MiltondSilva
This solved the problem: (defn ask-material [a-key the-ref old-state new-state] (if (<= new-state 0) (dosync (alter material + (int (rand 10) (str "asked for materials")) When the function ask-materials is invoked, it updates the state of the agent that caused

refs, agents and add-watch

2010-02-10 Thread MiltondSilva
I have this code: (def material (ref 2)) (def products-store (ref 2)) (def products (ref 0)) (def artisan (agent "idle")) (defn manufacture [state] (dosync (alter material dec) (alter products inc)) (str "idle")) (defn ask-material [a-key the-ref o

Re: (list* ())

2010-01-22 Thread MiltondSilva
See this: http://groups.google.com/group/clojure/browse_thread/thread/bc938600ddaaeada/0600e5c3f0c44770?lnk=gst&q=nil#0600e5c3f0c44770 -- 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