Re: Overtone - Live @ Arnolfini

2012-08-04 Thread Sam Aaron
Hi Robert, thank-you for your kind words. Andrew Sorensen has been a huge influence for me, so it's really rather humbling for you to describe my efforts as being comparable to his. BTW, you should check out his latest project Extempore - it's pretty remarkable. Overtone doesn't really have di

Clojure contrib profiler error

2012-08-04 Thread Adrian Mowat
Hi All I'm trying to run the clojure contrib profiler and I'm getting an error. Has anyone faced the same problem? user=> (use 'clojure.contrib.profile) nil user=> (defn my-function [x y] (let [sum (prof :addition (+ x y)) product (prof :multiplication (* x

Re: Clojure contrib profiler error

2012-08-04 Thread Jonathan Fischer Friberg
clojure.contrib is not supported in clojure versions 1.3+ The reason in this case is that in 1.3+, it is necessary to add ^:dynamic or ^{:dynamic true} in the def form (i.e. to the metadata) for the var to be dynamically changed with bindings. Fixed clojure.contrib.profile: https://gist.github.com

Re: Clojure contrib profiler error

2012-08-04 Thread Softaddicts
You are running clojure 1.3 or greater with the pre-1.3 contrib. Since 1.3, contrib has been split in separate libs, you can find where the different parts have moved here; http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go The profiling stuff did not make it it seems. A java pro

Re: doc strings for both interfaces and concrete implementations

2012-08-04 Thread Warren Lynn
I won't object, and the alter-meta! approach allows you to do that. Of > course, it cannot provide documentation for the implementations, but the > interface docs may be extended with impl docs incrementally at the > location where the implementation is defined. That's at least better > than

record constructor

2012-08-04 Thread Warren Lynn
My vague impression is this has been discussed somewhere, but I did not find a ticket in Jira when searching on "record, constructor", so I want to have some discussion here before considering entering a ticket myself. Often, when I create a record, I need to do some set-up more than just pass

Re: record constructor

2012-08-04 Thread Jim - FooBar();
for setting up objects as you say, I'm fine using (doto Object ... ... ...). Records, as everything else in Clojure promote immutability and so setting fields doesn't really make sense unless you're consuming external java classes in which case 'doto' suffices...at least that is the way I see

Re: community interest in machine learning (?)

2012-08-04 Thread Timothy Washington
Hey Jim, So I started playing around with clojure-encog, and I'm pretty excited about it so far. Again, I'm trying to make a financial series predictor. And I'm trying to go through the steps of 1) nomalizing / preparing the data 2) creating a feed-forward

Re: record constructor

2012-08-04 Thread Warren Lynn
On Saturday, August 4, 2012 1:15:13 PM UTC-4, Jim foo.bar wrote: > > for setting up objects as you say, I'm fine using (doto Object ... ... > ...). Records, as everything else in Clojure promote immutability and > so setting fields doesn't really make sense unless you're consuming > external

Re: community interest in machine learning (?)

2012-08-04 Thread Jim - FooBar();
p this is very strange...i'll update clojars within the next hour...sorry about this! Jim On 04/08/12 18:52, Timothy Washington wrote: Hey Jim, So I started playing around with clojure-encog , and I'm pretty excited about it so far. Again, I'm tr

Re: record constructor

2012-08-04 Thread Jim - FooBar();
On 04/08/12 19:14, Warren Lynn wrote: Here I am still creating immutable objects. You may say I am "setting" things, but that is for creating a new object. I am not sure I follow...If you're just creating a new record yourself, you can pass whatever you want to the constructor...no need for '

Re: community interest in machine learning (?)

2012-08-04 Thread Jim - FooBar();
Clojars has been updated with a clojure-encog jar containing all the namespaces...I'm really sorry I can't believe I hadn't noticed that! The code is in complete sync with github at the moment so instead of typing 'doc' all the time feel free to have a browser open...I've not changed much - I j

Re: community interest in machine learning (?)

2012-08-04 Thread Jim - FooBar();
I will address your second issue shortly...You say you have a lazy-seq of arrays that have 5 strings? why strings? Jim On 04/08/12 20:02, Jim - FooBar(); wrote: Clojars has been updated with a clojure-encog jar containing all the namespaces...I'm really sorry I can't believe I hadn't noticed t

Re: community interest in machine learning (?)

2012-08-04 Thread Jim - FooBar();
Hmmm, I think it is worth downloading the source for encog 3.1 for java and look into: org.encog.ml.data.temporal.TemporalMLDataSet I think this is what you need to add several columns...unfortunately I've not wrapped this yet so you will have to do some interop to get it going...I promise you

assoc! order problem

2012-08-04 Thread llj098
Hi list, I'm learning Clojure now and I was confused by assoc!. Here is my code , I want to use the code to distinct items (I cannot use 'distinct' function here for some reasons.) (defn fn2[x] (vals (persistent! (reduce (fn [ret l] (assoc! ret l l )) (transient {}) x user=>

assoc! order problem

2012-08-04 Thread Jeff Heon
You are using the map literal, which corresponds to the hash map. Use this if you want a sorted map: http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/sorted-map -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this grou

Re: assoc! order problem

2012-08-04 Thread Bronsa
Note that you can't use a sorted-map in a transient 2012/8/4 Jeff Heon > You are using the map literal, which corresponds to the hash map. > > Use this if you want a sorted map: > http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/sorted-map > > -- > You received this message b

Re: record constructor

2012-08-04 Thread Warren Lynn
> > I am not sure I follow...If you're just creating a new record yourself, > you can pass whatever you want to the constructor...no need for > 'setting' whatsoever...On the other hand if you're consuming an object > then you might need to 'set' some fields before it is useful (where doto >

ANN a CjOne TodoMVC implementation

2012-08-04 Thread Pierre-Henry Perret
Hello, I have published a local! -able - just dblClik ont index.html to load app, here [1] based on CjOne Running app here [0] [0] http://todomvc.herokuapp.com [1] https://github.com/phperret/peer-one.git -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: assoc! order problem

2012-08-04 Thread Warren Lynn
I have not used transient yet so I don't understand your code. But for ordered maps, I use ArrayMap. -- 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: community interest in machine learning (?)

2012-08-04 Thread Timothy Washington
Hey Jim, Thanks for looking into these things. I tried removing clojure-encog from lib/ and .m2/ . But '*lein deps*' still pulls in a jar without the normalization.clj file. Do I need an updated [clojure-encog "0.4.x-SNAPSHOT" ]? Also, I'll take a peek at the source for 'org.encog.ml.data.tempora

Re: community interest in machine learning (?)

2012-08-04 Thread Jim - FooBar();
On 04/08/12 22:47, Timothy Washington wrote: Thanks for looking into these things. I tried removing clojure-encog from lib/ and .m2/ . But '/lein deps/' still pulls in a jar without the normalization.clj file. Do I need an updated [clojure-encog"0.4.x-SNAPSHOT"]? aaa sorry! yes you now need

Re: record constructor

2012-08-04 Thread Jim - FooBar();
ok this is clearer now! I actually like what you're proposing just not in the form you're proposing it...since the record will already create 2 constructors in the underlying class, having essentially a 3rd sounds a bit crowded...minimally, you want (and I agree) the ability to optionally

Re: community interest in machine learning (?)

2012-08-04 Thread Timothy Washington
Ah, it looks like I have the right jar now. And one more thing. I'm looking at the TemporalMLDataSet.javasource, and I keep on seeing references to a 'windowSize'. What is a *input

Re: community interest in machine learning (?)

2012-08-04 Thread Jim - FooBar();
On 04/08/12 23:08, Timothy Washington wrote: And one more thing. I'm looking at the TemporalMLDataSet.java source, and I keep on seeing references to a 'windowSize'. What is a

Re: community interest in machine learning (?)

2012-08-04 Thread Timothy Washington
Ok, this makes sense. Thanks very much for your insights. Tim Washington Interruptsoftware.ca 416.843.9060 On Sat, Aug 4, 2012 at 6:21 PM, Jim - FooBar(); wrote: > On 04/08/12 23:08, Timothy Washington wrote: > > And one more thing. I'm looking at the > TemporalMLDataSet.java

Re: ANN a CjOne TodoMVC implementation

2012-08-04 Thread Pierre-Henry Perret
Using it in Chrome and then typing F12 allows to see all the clojure structures travelling along .. Le samedi 4 août 2012 23:20:50 UTC+2, Pierre-Henry Perret a écrit : > > Hello, > > I have published a local! -able - just dblClik ont index.html to load app, > here [1] > > based on CjOne > > Ru

Re: community interest in machine learning (?)

2012-08-04 Thread Jim - FooBar();
No worries... looking at the examples.clj in 0.4.1-SNAPSHOT, it is likely it won't even compile which is good evidence of how much your first email made me jump!!! If you want to run the examples just copy-paste the entire code in a namespace of your own while commenting out the travelling-s

Re: record constructor

2012-08-04 Thread Warren Lynn
On Saturday, August 4, 2012 6:07:20 PM UTC-4, Jim foo.bar wrote: > > ok this is clearer now! I actually like what you're proposing just > not in the form you're proposing it...since the record will already create > 2 constructors in the underlying class, having essentially a 3rd sounds a

Re: record constructor

2012-08-04 Thread Softaddicts
Count me as a fan I designed and wrote complex systems in assembly language many of them above 10k lines. Contrary to many commonly used languages, most assemblers have powerful macros, that feature alone allows you to implement sophisticated designs. As far as your OO related comments, may I poi

Re: record constructor

2012-08-04 Thread Sean Corfield
On Sat, Aug 4, 2012 at 5:30 PM, Softaddicts wrote: > Just use a high order fn as a factory to create your records and place it > along you record definition in the same name space with proper documentation. > > High order fns can be passed around and this can be quite valuable to be able > to spec

Re: record constructor

2012-08-04 Thread Warren Lynn
On Saturday, August 4, 2012 8:30:50 PM UTC-4, Luc wrote: > > Count me as a fan I designed and wrote complex systems in assembly > language > many of them above 10k lines. > > I can only admire you for that. Assemly language certain has its uses, but it is not really for average folks like m

Re: record constructor

2012-08-04 Thread Warren Lynn
> (and to be honest, Warren, I think you're beating yourself up somewhat > by trying to shoehorn OO practices into Clojure in the first place but > maybe that's something everyone goes thru if they are heavily steeped > in OO thinking, when they first try to adopt an FP language?) > > As diff

Strange coercions...

2012-08-04 Thread Pierre-Henry Perret
Running a lein2 check gives -> ___ Exception in thread "main" java.lang.IllegalArgumentException: No implementation of method: :as-file of protocol: #'clojure.java.io/Coercions found for class: c lojure.lang.PersistentVector ___

Question about sets

2012-08-04 Thread Mark Engelberg
What is the reasoning behind the design decision that this generates an error: (let [a :x b :x] #{a b}) rather than just returning #{:x} ? I'm finding that in practice, it limits the utility of #{} notation if you have to somehow know in advance that all the things in the set are different. -- Y

Strange coercions

2012-08-04 Thread Pierre-Henry Perret
Running a lein2 check gives -> ___ Exception in thread "main" java.lang.IllegalArgumentException: No implementation of method: :as-file of protocol: #'clojure.java.io/Coercions found for class: c lojure.lang.PersistentVector ___

Strange coercions

2012-08-04 Thread Pierre-Henry Perret
Running a lein2 check gives -> ___ Exception in thread "main" java.lang.IllegalArgumentException: No implementation of method: :as-file of protocol: #'clojure.java.io/Coercions found for class: c lojure.lang.PersistentVector ___

Re: record constructor

2012-08-04 Thread Timothy Baldridge
Warren, I can't speak for others, but I can say that personally one of the reasons I love Clojure so much is that it doesn't try to be a OOP language, instead it cleanly separates data from logic. Clojure is not a OOP language and (hopefully) will never attempt to be so. But this separation of logi

Re: record constructor

2012-08-04 Thread Sean Corfield
On Sat, Aug 4, 2012 at 6:33 PM, Warren Lynn wrote: > As difficult as you can see why I keep coming up crazy OO-like proposals, I > am also puzzled by the seemingly OO-phobia in the community. I don't think it is "OO-phobia". I think a lot of people here have used (several) OO languages and just f

Re: Strange coercions...

2012-08-04 Thread Sean Corfield
Post your project.clj. I suspect you have a symbol name where you should have a string... On Sat, Aug 4, 2012 at 6:42 PM, Pierre-Henry Perret wrote: > > Running a lein2 check gives -> > ___ > Exception in thread "main" java.lang.IllegalArgumentException: No > imple

Re: Question about sets

2012-08-04 Thread Sean Corfield
On Sat, Aug 4, 2012 at 6:43 PM, Mark Engelberg wrote: > What is the reasoning behind the design decision that this generates an > error: > (let [a :x b :x] #{a b}) > rather than just returning #{:x} ? My first reaction was that literals have to obey the rules of the underlying type or else they a

Re: Strange coercions

2012-08-04 Thread Pierre-Henry Perret
More precisely: ___ Unsupported character: \\- Le dimanche 5 août 2012 03:45:59 UTC+2, Pierre-Henry Perret a écrit : > > Running a lein2 check gives -> > ___ > Exception in thread "main" java.lang.IllegalArgumentExcepti

Re: record constructor

2012-08-04 Thread Warren Lynn
On Saturday, August 4, 2012 9:57:55 PM UTC-4, tbc++ wrote: > > Warren, I can't speak for others, but I can say that personally one of the > reasons I love Clojure so much is that it doesn't try to be a OOP language, > instead it cleanly separates data from logic. Clojure is not a OOP language

Re: record constructor

2012-08-04 Thread Warren Lynn
I don't think it is "OO-phobia". I think a lot of people here have > used (several) OO languages and just find the FP way better - or at > least better for the problems they are solving. > If I am proposing something like state-mutation based OOP, that clearly conflicts with FP and I will ju

Re: record constructor

2012-08-04 Thread Sean Corfield
On Sat, Aug 4, 2012 at 8:33 PM, Warren Lynn wrote: > Simplicity is good, only when it is not too simple. Factory functions > denitely have its value, but for more dynamic cases (so you may even create > different record types based on the arguments). For static cases, why > scatter the factory fun

Re: Strange coercions

2012-08-04 Thread Sean Corfield
Could you post your project.clj file? (I asked in the other thread so you can post it there or here) On Sat, Aug 4, 2012 at 8:02 PM, Pierre-Henry Perret wrote: > More precisely: > ___ > Unsupported character: \\- > > > > Le dimanche 5 août 2012 03:45:

Re: Question about sets

2012-08-04 Thread Mark Engelberg
On Sat, Aug 4, 2012 at 7:23 PM, Sean Corfield wrote: > I hadn't even thought of using the set literal syntax with variables > that might not have unique value. I guess I'd ask: why not use the set > function? > > (let [a :x b :x] (set [a b])) ;; #{:x} > > Yes, my first thought was, "I can just wor

Re: Question about sets

2012-08-04 Thread Mark Engelberg
Perhaps you don't use sets as much as I do, so to help you put it in perspective, imagine how you'd feel if I told you: "Oh by the way, that nice vector notation you use to write things like [1 3 5 7 2]. Yeah, well, it's only reliable if there are constants inside. That thing you've been doing wh

Re: Question about sets

2012-08-04 Thread Baishampayan Ghose
To add my two cents, IMHO the literal notation for sets, vectors & maps are just that---they are the "literal" representations of those data-structures and are not semantically equivalent to constructor functions. As such, the literal notation should really be used with constants; in every other ca

Re: Question about sets

2012-08-04 Thread Sean Corfield
On Sat, Aug 4, 2012 at 10:52 PM, Mark Engelberg wrote: > Yes, my first thought was, "I can just work around this by changing every > occurrence of something like #{a b} to (set [a b])." I guess my thinking is a literal doesn't contain variables :) I'd have #{1 2 3} and #{:a :b :c} and #{'x 'y 'z

Re: Question about sets

2012-08-04 Thread Mark Engelberg
On Sat, Aug 4, 2012 at 11:05 PM, Baishampayan Ghose wrote: > To add my two cents, IMHO the literal notation for sets, vectors & > maps are just that---they are the "literal" representations of those > data-structures and are not semantically equivalent to constructor > functions. As such, the lite

Re: Question about sets

2012-08-04 Thread Sean Corfield
On Sat, Aug 4, 2012 at 11:45 PM, Mark Engelberg wrote: > In any case, Clojure is already able to detect when x and y are equal in > something like #{x y} and report it as an error. So do you think #{1 1} should not be an error? And {:a 1 :a 2}? These seem like "obvious" programmer errors that I'd