Re: Idea around SCMs and Clojure

2012-07-22 Thread Tim Snyder
There are/have been some implementations of the ideas mentioned in the original post: 1. Smalltalk - I used the Squeak implementation in college and found it terribly frustrating when the image would crash. 2. IBM VisualAge for Java - I used this about 15 years ago. It still used files for each

Re: Clojure Sticker

2012-07-22 Thread TAKANO `takano32' Mitsuhiro
+1 2012/7/20 Syed Mazhar udDaula Khurram j2ee.soluti...@gmail.com: +1 On Thu, Jul 19, 2012 at 10:41 PM, George McKinney ghalbert...@gmail.com wrote: +1 On Saturday, June 9, 2012 6:03:46 PM UTC-7, aboy021 wrote: Is there anywhere that I can get a Clojure sticker? -- You received this

ANN: Typed Clojure 0.1-alpha5

2012-07-22 Thread Ambrose Bonnaire-Sergeant
Hi, I'm excited to release another Typed Clojure alpha. https://github.com/frenchy64/typed-clojure Leiningen: [typed 0.1-alpha5] TC is usable enough to play around with, but has many limitations, some outlined in the README. See the examples, you can check them like so:

Re: why does this anonymous function work with 'map' but not 'apply'?

2012-07-22 Thread larry google groups
Hmm, okay, so if apply unpacks all the arguments and feeds them all to my anonymous function, then this should work: (apply #([ everything] println first everything) @visitors) but instead I get: Unable to resolve symbol: in this context [Thrown class java.lang.RuntimeException]

Re: community interest in machine learning (?)

2012-07-22 Thread Joshua Bowles
Thanks for the references. *You have to realize that using lazy-seqs and clojure collections in general are non-starters since they don't yet support primitives yet and will never be as optimized as existing Fortran (read BLAS/LAPACK) and Java code.* Good point. I wasn't even thinking abou

Re: why does this anonymous function work with 'map' but not 'apply'?

2012-07-22 Thread Mark Rathwell
Arguments are implicit with the #(...) form, if you want explicit arguments you can use (fn [ e] (println (first e))). But, in that case, there is no reason for apply. apply turns this: (apply str [a b c]) into this: (str a b c) If you want to use all elements in a collection as

Re: why does this anonymous function work with 'map' but not 'apply'?

2012-07-22 Thread Laurent PETIT
Le 22 juil. 2012 à 18:39, larry google groups lawrencecloj...@gmail.com a écrit : Hmm, okay, so if apply unpacks all the arguments and feeds them all to my anonymous function, then this should work: (apply #([ everything] println first everything) @visitors) This should read:

Prefix dot in protocol method

2012-07-22 Thread Warren Lynn
I found that if I define a protocol like this: (defprotocol IProc (procMethod [this] some method)) I can invoke it on a type either (procMethod object) or (.procMethod object) Note the prefix dot in the second case. I like this dot version because that means I can replace a record field

Any downside of record compared to map

2012-07-22 Thread Warren Lynn
I plan to change all my major data structures to records instead of plain maps. Since record has everything a map provides, I figure there won't be any harm. But is that really so? Would appreciate the opinions from people who know better. -- You received this message because you are

is their a Clojure framework for handling form validation?

2012-07-22 Thread larry google groups
Since 2000 I've been doing web development, first with PHP and then with Ruby On Rails. In the world of PHP, there are some frameworks, such as Symfony, that have classes for managing forms, both generating the HTML for the forms, and also handling the validation of the forms. In the world of

Doc string for variables and record

2012-07-22 Thread Warren Lynn
In Elisp, with defvar I can specify a docstring for a variable. I could not find how to do that in Clojure with def and defrecord. Can someone show me the way? Thank you. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send

Re: Doc string for variables and record

2012-07-22 Thread Sean Corfield
On Sun, Jul 22, 2012 at 5:34 PM, Warren Lynn wrn.l...@gmail.com wrote: In Elisp, with defvar I can specify a docstring for a variable. I could not find how to do that in Clojure with def and defrecord. Can someone show me the way? Thank you. http://clojure.org/special_forms (def sym docstring

Re: Doc string for variables and record

2012-07-22 Thread Warren Lynn
http://clojure.org/special_forms (def sym docstring 'value) I don't think defrecord creates a Var so I don't think you can specify a docstring for that? Thanks that works for symbols. I know derecord does not create a Var, but it would still be nice to be able to have a doc string.

Re: Any downside of record compared to map

2012-07-22 Thread Lee Spector
On Jul 22, 2012, at 7:42 PM, Warren Lynn wrote: I plan to change all my major data structures to records instead of plain maps. Since record has everything a map provides, I figure there won't be any harm. But is that really so? Would appreciate the opinions from people who know better. I

Re: Any downside of record compared to map

2012-07-22 Thread Sean Corfield
On Sun, Jul 22, 2012 at 6:25 PM, Lee Spector lspec...@hampshire.edu wrote: I know I'm in the minority but I happen to prefer maps to records, and in fact I really like struct-maps which I gather may (?) not be long for this world. Nonetheless, since you asked, following are two old messages

Re: Any downside of record compared to map

2012-07-22 Thread Warren Lynn
I don't think you're in the minority. I prefer regular maps to records in general. struct-map was deprecated a long time ago (in Clojure 1.2). clojure.java.jdbc stopped using struct-map a while back - at the recommendation of Clojure/core - in favor of regular maps. Chas Emerick's

Re: Any downside of record compared to map

2012-07-22 Thread Sean Corfield
On Sun, Jul 22, 2012 at 8:54 PM, Warren Lynn wrn.l...@gmail.com wrote: Could you elaborate a little bit more? I know there is a chart, but the chart does not tell you why. Hmm, I thought the flowchart gave pretty good reasons, sorry :( Records aren't as flexible and you'll lose the type anyway

Re: Any downside of record compared to map

2012-07-22 Thread Takahiro Hozumi
I think defrecord has 5 downsides compared to regular map. 1. The literal of regular map is eye-friendly and portable. However I still don't know how helpful instant literals added in clojure 1.4 is for records. 2. The construction of record depends on an order of arguments. Sometimes, I feel

Re: Any downside of record compared to map

2012-07-22 Thread Baishampayan Ghose
On Mon, Jul 23, 2012 at 10:37 AM, Takahiro Hozumi fat...@googlemail.com wrote: 2. The construction of record depends on an order of arguments. Sometimes, I feel that a lack of construction with key-value style is not convenient. (defrecord Foo ... will give you `-Foo` `map-Foo` for free. The

Re: Any downside of record compared to map

2012-07-22 Thread Takahiro Hozumi
Baishampayan I didn't know `map-Foo`. Thank you for the infomation! On Monday, July 23, 2012 2:11:45 PM UTC+9, Baishampayan Ghose wrote: On Mon, Jul 23, 2012 at 10:37 AM, Takahiro Hozumi fat...@googlemail.com wrote: 2. The construction of record depends on an order of arguments.