Re: Looking to help out with an open source web scanner

2012-06-17 Thread Baishampayan Ghose
Take a look at Itsy, a similar but simpler project written in Clojure https://github.com/dakrone/itsy Regards, BG On Sun, Jun 17, 2012 at 4:31 AM, pvt liweijian.h...@gmail.com wrote: Hello Clojure fans. I'am new to clojure, I've learned clojure for sometime, wow~ it's an interesting

Re: Is there a better way to do this

2012-06-17 Thread Joao_Salcedo
Hi ALL, Thanks that is exactly what i was looking for :) On Saturday, June 16, 2012 12:30:45 AM UTC+10, Baishampayan Ghose wrote: Hi Baishampayan, (defn get-events-hlpr [] Retrieves events from MongoDB. (vec (mc/find-maps events))) Is that Emacs Lisp or Common Lisp?

Re: Is there a better way to do this

2012-06-17 Thread Joao_Salcedo
Hi Sean, That works just perfect !!! JS On Saturday, June 16, 2012 11:58:30 AM UTC+10, Sean Corfield wrote: On Fri, Jun 15, 2012 at 7:30 AM, Baishampayan Ghose b.gh...@gmail.com wrote: This is how it should be done, really - (defn get-events-hlpr Retrieves events from MongoDB.

Re: Catnip

2012-06-17 Thread Vinzent
Never heard of it before, but it seems interesting. Thank you for pointing to it. воскресенье, 17 июня 2012 г., 5:51:33 UTC+6 пользователь Christian Guimaraes написал: Hi, Anybody here already used catnip (https://github.com/bodil/catnip) to do some web developement? I saw this video

How to do aynchrounous producer/consumer

2012-06-17 Thread Jeff Rose
-- 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 moderated - please be patient with your first post. To unsubscribe from this group, send email to

How to do aynchrounous producer/consumer

2012-06-17 Thread Jeff Rose
Java has queues that will do just what you want, as well as thread pools to process the jobs. It's reasonable and idiomatic to use this stuff from Clojure. http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/ConcurrentLinkedQueue.html -Jeff -- You received this message

Re: Scheme dotted pair equivalent in Clojure

2012-06-17 Thread Paul Stadig
On Jun 16, 11:37 am, David Nolen dnolen.li...@gmail.com wrote: Not possible in Clojure and a source of hassle in Scheme and Common Lisp. If you have dotted pairs you can never know if you have a proper list. I'm probably missing some context, but I've heard this argument before and had a hard

Re: Classpath problem compiling or executing in emacs

2012-06-17 Thread Dave Kincaid
Thanks for replying, Sean. This was related to a similar post I made earlier. The problem was that I had switched to Leiningen 2 and my project.clj was still using :source-path instead of the new :source-paths []. An oversight on my part. Dave On Saturday, June 16, 2012 11:21:57 PM UTC-5,

separating protocols from records problem...

2012-06-17 Thread Jim - FooBar();
Hi guys, everyone suggested that I don't need to use '.' when calling methods from a record and in fact doing this gets rid of reflection...However, now that I moved my records in different namespaces than the protocols they satisfy it seems that I can no longer do that! example follows:

Re: separating protocols from records problem...

2012-06-17 Thread Jim - FooBar();
Yes, importing the 2 records I have so far into the core namespace where the protocols live solves the problem but I have to use dot notation to call the methods even from within the definition of the record. That is not what worries me the most though... the real problem now is the fact that

Re: separating protocols from records problem...

2012-06-17 Thread Vinzent
Forget about .method thing. It's an interop form and, strictly speaking, has nothing to do with protocols. The fact that defining record with protocol implementation inline will create class with corresponding methods is just an implementation detail. Protocol functions are just functions; you

Re: separating protocols from records problem...

2012-06-17 Thread Jim - FooBar();
aha!!! Protocols produce namespaced functions!!! I don't need to import anything to core...I just need to call the functions with core/f since the protocol exists in core...so simple! sorry to bother you with something so trivial on a Sunday! Jim On 17/06/12 14:27, Jim - FooBar(); wrote:

Re: separating protocols from records problem...

2012-06-17 Thread Jim - FooBar();
On 17/06/12 14:44, Vinzent wrote: Forget about .method thing. It's an interop form and, strictly speaking, has nothing to do with protocols. The fact that defining record with protocol implementation inline will create class with corresponding methods is just an implementation detail.

Re: separating protocols from records problem...

2012-06-17 Thread Vinzent
You're welcome :) -- 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 moderated - please be patient with your first post. To unsubscribe from this group,

Re: Doseq, map-style

2012-06-17 Thread Vinzent
Well, if those assertions are violated, you can't do anything with it anyway - you program is written wrong and you have to release new version which'll fix it. воскресенье, 17 июня 2012 г., 1:41:17 UTC+6 пользователь Alex Baranosky написал: To test for violations of those assertions,

Re: Doseq, map-style

2012-06-17 Thread Vinzent
This still requires changing your code to @(:emails contact). If you use (emails contact) you need change your code in only one place. The name emails implies that it's a sequence. Lazy sequence. Property is just the OO word for function, semantically they are the same. OO doesn't

Re: Doseq, map-style

2012-06-17 Thread Vinzent
A really good clojure specific example of data vs api is the discussion regarding if the clojurescript analyzer should contain children or if children should be a multimethod https://groups.google.com/forum/m/?fromgroups#!topic/clojure-dev/vZLVKmKX0oc By the way, I have read the whole

Re: Doseq, map-style

2012-06-17 Thread Kurt Harriger
On Sunday, June 17, 2012 8:48:58 AM UTC-6, Vinzent wrote: Well, if those assertions are violated, you can't do anything with it anyway - you program is written wrong and you have to release new version which'll fix it. Yes, but if data in your database become corrupt then you may need to

Re: Doseq, map-style

2012-06-17 Thread Kurt Harriger
On Sunday, June 17, 2012 9:09:23 AM UTC-6, Vinzent wrote: This still requires changing your code to @(:emails contact). If you use (emails contact) you need change your code in only one place. The name emails implies that it's a sequence. Lazy sequence. Yes it is... emails was not

Re: Doseq, map-style

2012-06-17 Thread Vinzent
Yes it is... emails was not the best example in this case.. think the area example instead as this is single value rather than collection. Well, I thought we've already came to the agreement that area is a (polymorphic) function and it has nothing to do with structure of your data, no?

Re: How to write XML?

2012-06-17 Thread fenton
Thanks Mark that was it! On Friday, June 15, 2012 6:07:56 AM UTC-7, mwillson wrote: On Wednesday, 13 June 2012 20:35:41 UTC+1, fenton wrote: For some reason I cannot create an XML node. Sample code here.https://gist.github.com/ce66585542f4b426381c Any assistance much appreciated. I

Re: Scheme dotted pair equivalent in Clojure

2012-06-17 Thread Mark Engelberg
A cons is essentially just a struct with two fields. In Clojure, it's sort of like: (defrecord Cons [car cdr]) (defn cons [x y] (Cons. x y)) (defn first [x] (:car x)) (defn rest [x] (:cdr x)) The amazing thing is that you can represent any collection of arbitrary length, just by nesting these

Re: Scheme dotted pair equivalent in Clojure

2012-06-17 Thread Mark Engelberg
In the previous post, I accidentally deleted a dot when pasting: user= (clojure.lang.MapEntry :a 1) should have been user= (clojure.lang.MapEntry. :a 1) -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Docstring state deftype, defrecord etc. are still alpha?

2012-06-17 Thread Tim Visher
The answer I get from IRC is always that 'Rich likes to hedge'. On Sat, Jun 16, 2012 at 3:24 AM, László Török ltoro...@gmail.com wrote: Hi, I was reviewing some of the docstrings of programming constructs in the clojure.core namespace. I noticed that deftype and defrecord is still marked as

Re: Doseq, map-style

2012-06-17 Thread Kurt Harriger
On Jun 17, 2012, at 10:45 AM, Vinzent ru.vinz...@gmail.com wrote: Yes it is... emails was not the best example in this case.. think the area example instead as this is single value rather than collection. Well, I thought we've already came to the agreement that area is a (polymorphic) function

Re: Scheme dotted pair equivalent in Clojure

2012-06-17 Thread Jonas
A very nice section of SICP[1] describes how cons/car/cdr can be built only with functions. Translated to Clojure it might look like (defn cons [a b] #(condp = % :car a :cdr b)) (defn car [cons-cell] (cons-cell :car)) (defn cdr [cons-cell]

Namespace loading with deftype/defrecord used from Java

2012-06-17 Thread Warren Lynn
Basically, the issue is: When a deftype/defrecord named class is used from Java, its containing namespace is not loaded automatically, so even calling a function in the same namespace will raise an exception like this: java.lang.IllegalStateException: Attempting to call unbound fn ... An

Re: How to do aynchrounous producer/consumer

2012-06-17 Thread Warren Lynn
Thank you all for the suggestions. I decided to use Java as lamina seems an overkill for me and I may lose some control over things I want to have. I was wishing for a pure Clojure solution, but a wrapping layer over the Java works fine. On Sunday, June 17, 2012 4:43:17 AM UTC-4, Jeff Rose

clojure/java.jdbc: MySQL problem NoRouteToHostException Cannot assign requested address

2012-06-17 Thread Raju Bitter
Hi all, I'm running into a problem with the clojure/java.jdbc wrapper. In my program, I'm reading out a large text file and inserting around 24000 items into one table. After around 18000 items I get the following error message: NoRouteToHostException Cannot assign requested address

Re: Doseq, map-style

2012-06-17 Thread Vinzent
Data structure is an implementation detail... It's not. Not in clojure. It is in OO, but clojure is not an OO language, so it's not an implementation detail in clojure. interfaces are contracts, if the data representation changes in OO you need only change one class... Well, but if

meta-questions - [clojure] in front of Subject line

2012-06-17 Thread Andy Coolware
Hi, I have been subscribed to a couple of groups as well as other stuff and find it useful to have a Subject line prefix indicating the source of conversation. Would it be possible to add something like that [clojure] Thx, Andy -- You received this message because you are subscribed to the

Re: Docstring state deftype, defrecord etc. are still alpha?

2012-06-17 Thread Vinzent
I still hope we'll get rid of those ugly -Foo constructors some day. Also, protocols aren't fully implemented yet (no way to get implementation of a protocol for the given type, no way to resolve confilcts (like prefer-method), etc) суббота, 16 июня 2012 г., 13:24:04 UTC+6 пользователь Las

Re: Doseq, map-style

2012-06-17 Thread Vinzent
That is my point, representations SHOULD be considered implementation details, because representations change... if you treat them as contracts your code will break everywhere, if you wrap them with abstractions your code will only need to change in one place... As I mentioned above,

Re: Doseq, map-style

2012-06-17 Thread Softaddicts
Your first lisp ? I suggest you immersed yourself in it. Clojure is my third. Clojure is different from past languages because it allows features that have existed for a number of years separately to coexist together nicely. Many languages in the past have been created based on a couple of these

Re: Doseq, map-style

2012-06-17 Thread Kurt Harriger
On Sunday, June 17, 2012 1:41:22 PM UTC-6, Vinzent wrote: That is my point, representations SHOULD be considered implementation details, because representations change... if you treat them as contracts your code will break everywhere, if you wrap them with abstractions your code will

Re: meta-questions - [clojure] in front of Subject line

2012-06-17 Thread Brian Marick
On Jun 17, 2012, at 1:45 PM, Andy Coolware wrote: I have been subscribed to a couple of groups as well as other stuff and find it useful to have a Subject line prefix indicating the source of conversation. +1 - Brian Marick, Artisanal Labrador Now working at http://path11.com Contract

Re: meta-questions - [clojure] in front of Subject line

2012-06-17 Thread Phil Hagelberg
Have you considered a more capable client? -Phil On Jun 17, 2012 11:45 AM, Andy Coolware andy.coolw...@gmail.com wrote: Hi, I have been subscribed to a couple of groups as well as other stuff and find it useful to have a Subject line prefix indicating the source of conversation. Would it

Re: meta-questions - [clojure] in front of Subject line

2012-06-17 Thread Brian Marick
On Jun 17, 2012, at 6:22 PM, Phil Hagelberg wrote: Have you considered a more capable client? My client is OSX Mail. I don't think it's a marginal client. What inconvenience would users of more capable clients suffer if a [clojure] were added? Given that the change to Google Groups is

Re: clojure/java.jdbc: MySQL problem NoRouteToHostException Cannot assign requested address

2012-06-17 Thread Sean Corfield
Since you don't see the problem with connection pooling in play, I suspect your code is structured so that it is holding connections open over the inserts. Without connection pooling, a new connection is created for each DB operation. It's also possible you've found a bug in c.j.jdbc that is

Re: meta-questions - [clojure] in front of Subject line

2012-06-17 Thread Peter Buckley
Having [clojure] in front of the subject obscures the subject with redundant information. It's wasting valuable space at the front of the subject line that could be used for, well, the subject, which I'm actually interested in. The mail is already from clojure@googlegroups, to

Re: Doseq, map-style

2012-06-17 Thread Sean Corfield
On Sun, Jun 17, 2012 at 11:59 AM, Kurt Harriger kurtharri...@gmail.com wrote: That is my point, representations SHOULD be considered implementation details, because representations change... if you treat them as contracts your code will break everywhere, if you wrap them with abstractions your

Re: Doseq, map-style

2012-06-17 Thread Sean Corfield
On Sun, Jun 17, 2012 at 1:32 PM, Kurt Harriger kurtharri...@gmail.com wrote: If you follow the hollywood principle you don't need getters... but you do need side-effects. This might be where you're getting stuck then? Perhaps the hollywood principle isn't the best approach? If you think it

Re: meta-questions - [clojure] in front of Subject line

2012-06-17 Thread Sean Corfield
On Sun, Jun 17, 2012 at 5:23 PM, Peter Buckley buckmeist...@gmail.com wrote: Having [clojure] in front of the subject obscures the subject with redundant information. It's wasting valuable space at the front of the subject line that could be used for, well, the subject, which I'm actually

Re: meta-questions - [clojure] in front of Subject line

2012-06-17 Thread Lee Spector
On Jun 17, 2012, at 8:23 PM, Peter Buckley wrote: Having [clojure] in front of the subject obscures the subject with redundant information. It's wasting valuable space at the front of the subject line that could be used for, well, the subject, which I'm actually interested in. The mail

Re: meta-questions - [clojure] in front of Subject line

2012-06-17 Thread Sean Corfield
On Sun, Jun 17, 2012 at 5:54 PM, Lee Spector lspec...@hampshire.edu wrote: Mac OS X Mail.app does indeed allow filtering by addresses, etc. Nonetheless, for some people and some workflows (including me any my workflow) it'd be helpful to have a textual marker in the subject line. Not a huge

Re: Doseq, map-style

2012-06-17 Thread Kurt Harriger
On Sunday, June 17, 2012 6:31:34 PM UTC-6, Sean Corfield wrote: On Sun, Jun 17, 2012 at 11:59 AM, Kurt Harriger kurtharri...@gmail.com wrote: That is my point, representations SHOULD be considered implementation details, because representations change... if you treat them as

Re: Doseq, map-style

2012-06-17 Thread Timothy Baldridge
I have also found that clojure code lacks cohesion we hate objects so we are just going to throw everything into one large namespace and say we have none... In OO I might call this a god class? I don't know, I'm not sold yet... but I'll keep watching. That depends. In OOP we might call it

Re: Doseq, map-style

2012-06-17 Thread Sean Corfield
On Sun, Jun 17, 2012 at 8:06 PM, Kurt Harriger kurtharri...@gmail.com wrote: One of the sayings I hear reiterated is it is better to have 100 methods that operate on one data structure than 10 methods that operate on 10 data structures.  Yet how is this different from one large interface with a

Re: Doseq, map-style

2012-06-17 Thread Kurt Harriger
On Jun 17, 2012, at 9:38 PM, Timothy Baldridge tbaldri...@gmail.com wrote: I have also found that clojure code lacks cohesion we hate objects so we are just going to throw everything into one large namespace and say we have none... In OO I might call this a god class? I don't know, I'm not

Re: Doseq, map-style

2012-06-17 Thread Kurt Harriger
On Jun 17, 2012, at 9:46 PM, Sean Corfield seancorfi...@gmail.com wrote: On Sun, Jun 17, 2012 at 8:06 PM, Kurt Harriger kurtharri...@gmail.com wrote: One of the sayings I hear reiterated is it is better to have 100 methods that operate on one data structure than 10 methods that operate on 10

Re: meta-questions - [clojure] in front of Subject line

2012-06-17 Thread Brian Marick
On Jun 17, 2012, at 7:23 PM, Peter Buckley wrote: I know mac products are designed for non-technical people and leave out most common options, but can't they do something so simple and 1980's-esque as filter on a field other than subject? I've been using gmail and have had a rule for the

Re: meta-questions - [clojure] in front of Subject line

2012-06-17 Thread Phil Hagelberg
On Sun, Jun 17, 2012 at 9:31 PM, Brian Marick mar...@exampler.com wrote: The complaint about reading the mailing list on phones is valid. I do wonder how many people use phones as their main, workaday interface, and how much an extra inconvenience 9 characters is when they're already trying