Re: ritz-nrepl starts up slowly?

2013-05-13 Thread Chris Ford
You could try lein -o to make sure that your startup isn't blocking on
network.


On 14 May 2013 01:50, yizhen wei  wrote:

> I heard using a sdd can reduce the time a lot. Maybe 5x?
> Can someone confirm on that?
>
>
> On Monday, May 13, 2013 6:17:38 PM UTC-4, Warren Lynn wrote:
>>
>>
>>
>>> Is it normal to take this long to start the repl?
>>>
>>>
>>>
>> I don't know if it is normal. But I can confirm it takes much longer to
>> start ritz-nrepl compared to nrepl only, which itself is already kind of
>> slow. The slow speed really is killing a lot of fun here.
>>
>  --
> --
> 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
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Mike Thvedt
In regards to the allocation objection--how often are you calling seq 
millions of times on something that's not already a seq? In re using count 
instead of seq, a lazy seq's count might be arbitrarily expensive to 
calculate and might not be able to tell if it's empty without realizing its 
head.

On Monday, May 13, 2013 4:21:54 AM UTC-5, Meikel Brandmeyer (kotarak) wrote:
>
>
> 2013/5/13 Mike Thvedt >
>
>> A good implementation of ISeq won't return a new object, and new 
>> short-lived objects are cheap on the JVM anyway. OTOH count can be slow for 
>> some data structures. if you don't like instantiating lots of new objects 
>> only to throw them away, you're missing out on one of HotSpot's most 
>> significant performance/convenience sweet spots, so it's strange you call 
>> that premature optimization.
>>
>> There is however an optimization story against seq: Hotspot (at least on 
>> my machine) refuses to inline the call to seq by default (it might still 
>> inline if the stars are right or something, the JVM is mysterious). My 
>> guess is it's because the code in seq and seqFrom is too big, on my box it 
>> exceeds the inline threshold by one byte...
>>
>>
> I'm not sure what you mean. For an ISeq seq won't return a new object. 
>  But for everything else it will. And count is cheap (a simple field 
> access) for clojure data structures (a seq is not a data structure). While 
> initialising an immediately-to-be-thrown-away object might be (relatively) 
> expensive even when allocation is cheap.
>
> I called my point of view "premature optimisation" because it's probably 
> like you said: allocation is cheap and initialisation usually not worth 
> worrying about. So worrying about it is "premature optimisation".
>
> I still feel empty? to be too ugly in its current implementation. (And to 
> be honest: I almost never needed it, up to now...)
>
> Meikel
>
>  

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: unusual question: how do you get morale?(or moral support)

2013-05-13 Thread Armando Blancas
Zack, you've probably come across this profile on Jeff Hammerbacher, but 
just in case.

"The best minds of my generation are thinking about how to make people 
click ads," he says. "That sucks."

http://www.businessweek.com/printer/articles/55578-this-tech-bubble-is-different

On Monday, May 13, 2013 2:03:10 PM UTC-7, Zack Maril wrote:
>
> One of the reasons I program is because I'm furious. 
>
> By most accepted metrics, I went to one of the best technical public high 
> schools in the country. I was average there and I was taking graph theory 
> and multivariable calculus as a senior my last semester. The smart kids 
> though? They were doing real analysis, topology, and winning international 
> competitions for mathematics and science. I'm just finishing up college now 
> and I'm watching the geniuses from my high school go from MIT and Stanford 
> to high frequency trading firms or work for places like palantir and 
> facebook. They're using their gifts to remove liquidity from the 
> markets[0], to help fight wars based on lies[1], and to maximize the amount 
> of money they can sell my privacy for[2]. Most of them use programming to 
> indirectly decrease the quality of my life. I'd love it if I could invest 
> money without fear of the markets going crazy because of a tweet[3], if I 
> could support the government without worrying about them killing innocent 
> citizens[4], and if I could connect with my friends and family without 
> worrying about my privacy being sold to the highest bidder. My former 
> classmates are and will be using computers to indirectly prevent me from 
> doing the above with any sort of peace of mind. It is infuriating. 
>
> When I sit down to program, I now make a conscious effort to build tools 
> that I can use in the future to fight against the trends above. I use 
> Clojure because it's the language I've been able to get the most done in 
> the shortest amount of time. If there were a language that let me do as 
> much as fast, I'd drop Clojure like a rock and learn that. If I want to 
> stem the negative effects the geniuses are having on my life, I'll need to 
> use the best tools possible. That means constantly learning more powerful 
> concepts and building better tools. I've been on a graph theory and network 
> science kick lately because I noticed that google, palantir, and facebook 
> got where they are by virtue of being really good at graph theory. The 
> concepts are crazy powerful and provide immense power to the people who can 
> successfully employ them. 
>
> So, when I sit down to work on certain projects, the main motivating 
> factor for me is that I'm furious that my classmates are worsening my life. 
> There's a ton of work that I need to do before I can do anything about it 
> though. I'm obviously on a futile crusade fueled by my youth and naiveté, 
> but for the moment, that's why I program.  
> -Zack
>
> [0] http://www.nanex.net/aqck2/4136.html
> [1] http://krugman.blogs.nytimes.com/2013/04/27/the-great-degrader/
> [2] https://www.facebook.com/legal/terms
> [3] 
> http://seekingalpha.com/article/1362731-obama-is-dead-tweet-makes-for-flash-crash
> [4] 
> http://www.latimes.com/news/opinion/editorials/la-ed-drones-policy-obama-koh-20130513,0,4160911.story
>
> On Monday, May 13, 2013 11:35:33 PM UTC+4, Erlis Vidal wrote:
>>
>> Let me share this tale with you guys, hope you like it as much as I do: 
>>
>> It is said that Socrates met a worker who asked: what are you doing good 
>> man? "Don't you see I'm cutting a stone to earn my salary and so I can 
>> eat" the worker replied. He moved on and later found another worker 
>> questioning the same way as the previous one, he replied "I'm building a 
>> wall," continued Socrates finding their way to a third worker, also 
>> questioning, the answer was "I'm building a beautiful palace "
>>
>>
>> On Mon, May 13, 2013 at 2:17 PM, Timothy Baldridge wrote:
>>
>>> I doubt I'm unique in this area, but for me, programming is a drug. I 
>>> have to code, or the ideas and thoughts build up in my mind. For me, 
>>> actually writing down and implementing these is a stress relief. Just ask 
>>> my parents when I was growing up, or my wife today. Keep me in a room 
>>> without a computer for a week, and I'll start writing code on paper just to 
>>> get the thoughts down.
>>>
>>> So I guess you could say I'm an addict.
>>>
>>> Timothy Baldridge 
>>>
>>>
>>> On Mon, May 13, 2013 at 12:09 PM, Ulises  wrote:
>>>
 > Code that matters is code that's used by other people. For me 
 personally
 > the ability to share my code with others is the thing that makes
 > programming worth doing in the first place.

 This is a rather important point. One of the most asked questions
 (random made up fact) by newcomers to a language is "what can I code?
 what open source programs can I help?". All with the aims of getting
 better acquainted with the language itself and, hopefully, helping
 others

Re: [ANN] Clojars policy change

2013-05-13 Thread Phil Hagelberg

Zack Maril writes:

> Is the policy for SNAPSHOT artifacts still that you can overwrite as much 
> and as often as you want?

Technically no, but effectively yes. Any version ending in "-SNAPSHOT"
is automatically translated into a timestamped version upon deploy or
resolution. So "0.5.0-SNAPSHOT" actually becomes
"0.5.0-20130513.233313-184", etc. You can deploy a new "0.5.0-SNAPSHOT"
which will result in a new expanded timestamp, but you can't deploy
another "0.5.0-20130513.233313-184" version. You can think of it as the
difference between a branch and a tag in a version control system.

Hope that makes sense.

I have a fix for the scp bug, but I am going to wait until tomorrow
morning before deploying it so I'll be around to monitor things if there
are issues.

-Phil


pgpOddwqfV8me.pgp
Description: PGP signature


Re: Utility libraries and dependency hygiene

2013-05-13 Thread Timothy Baldridge
Neither of these snarky answers solve the problem. I just spent an entire
week updating modules from version of a library that expected a seq of maps
to one that expected map of seqs of maps.  The very nature of data implies
a format. If that format changes you have a compatibility issue no fancy
namespace system can solve.

Timothy
On May 13, 2013 4:08 PM,  wrote:

> Or a reason to integrate via data, not api or type.
>
> On Monday, May 13, 2013 10:54:26 PM UTC+2, Phil Hagelberg wrote:
>>
>>
>> Stuart Sierra writes:
>> > That's cool, and it will work for the simple case of libraries A and B
>> > depending on different versions of C.
>> >
>> > But it still breaks down in more complex cases: e.g. if I want to share
>> > data between A and B using a protocol or type defined in C, and there
>> are 2
>> > incompatible versions of C. Even ClassLoaders can't help you there -
>> I'm
>> > not aware of any solution.
>>
>> One of many great reasons not to use protocols and records. =)
>>
>> -Phil
>>
>  --
> --
> 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
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Timothy Baldridge
Why shouldn't that be the case? A seq is a collection of data. And it's
immutable, why would it bein its own category of collections?

Timothy
On May 13, 2013 3:45 PM, "Philip Potter"  wrote:

> On 13 May 2013 17:30, Timothy Baldridge  wrote:
> >>> In fact, the way that count works on ISeqs is rather roundabout -- it
> > only works because all implementations of ISeq in clojure.jar also
> > happen to implement java.util.List, so count calls Collection.size().
> > In theory, some user-provided ISeq which didn't implement List would
> > not respond to count.
> >
> > --
> >
> > That is just completely untrue:
> >
> >
> https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L536
> >
> https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L826
>
> Thanks for the correction.
>
> I had read this code before and I read it again and couldn't see any
> mistake, until I looked at ISeq and realized it implements
> IPersistentCollection. That came as a surprise to me.
>
> I guess I'm used to treating seqs and colls as very separate ideas
> that I simply didn't expect that ISeq would implement
> IPersistentCollection.
>
> Phil
>
> > Timothy
> >
> >
> >
> > On Mon, May 13, 2013 at 10:17 AM, Philip Potter <
> philip.g.pot...@gmail.com>
> > wrote:
> >>
> >> In fact, the way that count works on ISeqs is rather roundabout -- it
> >> only works because all implementations of ISeq in clojure.jar also
> >> happen to implement java.util.List, so count calls Collection.size().
> >> In theory, some user-provided ISeq which didn't implement List would
> >> not respond to count.
> >>
> >> It's probably a good idea for interop reasons to have seqs implement
> >> the java collection types, but I don't feel too happy about clojure
> >> code which uses the java Collection interface on seqs.
> >>
> >> Phil
> >>
> >> On 13 May 2013 15:48, Meikel Brandmeyer (kotarak)  wrote:
> >> > Hi,
> >> >
> >> > Am Montag, 13. Mai 2013 16:16:57 UTC+2 schrieb Sean Corfield:
> >> >>
> >> >>
> >> >> So you think (count (map inc [1 2 3])) should be illegal?
> >> >>
> >> >> (I'm just trying to understand your logic here)
> >> >>
> >> >
> >> > In the hardcore version, yes. In the practical version, probably not.
> I
> >> > never had to call count on a seq. (Various versions of partition-by or
> >> > split
> >> > being a notable exception.) (Still a promised O(1) count would be nice
> >> > for
> >> > reasoning as we have it for contains?. What is clojure.lang.Counted
> good
> >> > for
> >> > anyway?)
> >> >
> >> > Meikel
> >> >
> >> > --
> >> > --
> >> > 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
> >> > clojure+unsubscr...@googlegroups.com
> >> > For more options, visit this group at
> >> > http://groups.google.com/group/clojure?hl=en
> >> > ---
> >> > You received this message because you are subscribed to the Google
> >> > Groups
> >> > "Clojure" group.
> >> > To unsubscribe from this group and stop receiving emails from it, send
> >> > an
> >> > email to clojure+unsubscr...@googlegroups.com.
> >> > For more options, visit https://groups.google.com/groups/opt_out.
> >> >
> >> >
> >>
> >> --
> >> --
> >> 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
> >> clojure+unsubscr...@googlegroups.com
> >> For more options, visit this group at
> >> http://groups.google.com/group/clojure?hl=en
> >> ---
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Clojure" group.
> >> To unsubscribe from this group and stop receiving emails from it, send
> an
> >> email to clojure+unsubscr...@googlegroups.com.
> >> For more options, visit https://groups.google.com/groups/opt_out.
> >>
> >>
> >
> >
> >
> > --
> > “One of the main causes of the fall of the Roman Empire was that–lacking
> > zero–they had no way to indicate successful termination of their C
> > programs.”
> > (Robert Firth)
> >
> > --
> > --
> > 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
> > clojure+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/clojure?hl=en
> > ---
> > You received this message because you are subscribed to the Google Groups
> > "Clojure" group.
> > To unsub

Re: unusual question: how do you get morale?(or moral support)

2013-05-13 Thread Michael Klishin
2013/5/12 AtKaaZ 

> How do you put yourself into that mood so that you're happy/willing to
> program? What motivates you to do it?


When it comes to work projects, I am personally motivated by building
something useful and
making a good living out of it. The process of programming is fairly
interesting to me,
but not all of the time.

When it comes to open source, I almost always work on something because I am

 * Really annoyed or infuriated by something
 * Really interested in something

So, have an enemy [1].

This is how ClojureWerkz and http://clojure-doc.org were started: I was
really unhappy about
the state of some libraries and the attitude towards documentation in the
Clojure community.
As time goes, seeing how other people use your projects becomes another
important
reason to continue working on OSS.

Finally, there aren't many ways to get your name known
in the technical community if you are not based in an area with an active
technology community (Bay area, NYC, London, Berlin, etc) and did not
attend a fancy
school. Open source and other side-projects is pretty much the only way.

1. http://gettingreal.37signals.com/ch02_Have_an_Enemy.php
-- 
MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] Clojars policy change

2013-05-13 Thread Zack Maril
Is the policy for SNAPSHOT artifacts still that you can overwrite as much 
and as often as you want?
-Zack

On Tuesday, May 14, 2013 3:30:19 AM UTC+4, Phil Hagelberg wrote:
>
>
> Phil Hagelberg writes: 
>
> > In the aftermath of the recent Linode intrusion[1][2], we determined 
> > that Clojars' policy of allowing artifacts to be overwritten[3] makes it 
> > much more difficult to detect an attack than it would be if artifacts 
> > were immutable like they are in most other repositories. 
>
> I've rolled this back briefly due to a bug surrounding deploying 
> SNAPSHOT versions over scp. 
>
> -Phil 
>

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] Clojars policy change

2013-05-13 Thread Phil Hagelberg

Phil Hagelberg writes:

> In the aftermath of the recent Linode intrusion[1][2], we determined
> that Clojars' policy of allowing artifacts to be overwritten[3] makes it
> much more difficult to detect an attack than it would be if artifacts
> were immutable like they are in most other repositories.

I've rolled this back briefly due to a bug surrounding deploying
SNAPSHOT versions over scp.

-Phil


pgpaJLlELyKKr.pgp
Description: PGP signature


[ANN] Clojars policy change

2013-05-13 Thread Phil Hagelberg

Hello everyone.

In the aftermath of the recent Linode intrusion[1][2], we determined
that Clojars' policy of allowing artifacts to be overwritten[3] makes it
much more difficult to detect an attack than it would be if artifacts
were immutable like they are in most other repositories.

While overwriting with redeploys has been known to cause all kinds of
issues around local cached repositories, there have typically been three
reasons for doing so anyway:

0) Replacing accidental deploys containing errors (missing file, typo, etc).
   This is essentially analogous to the argument for force-pushing in
   git; it saves you a bit of embarrassment but really isn't worth
   sacrificing the predictability of the repository in any case. Just
   cringe, push out your fixed version, and hope no one laughs at you
   when they're looking through the history.

1) Removing sensitive data which was deployed by accident.
   We've implemented a system of removal based on GitHub issues and a
   cont...@clojars.org address that should be used for this
   instead. Sometimes removal takes a while, but if you make it clear in
   your request that sensitive data is involved we can ensure it's
   deleted quickly.

2) Signing an already-deployed older version.
   This was the one thing that kept us from enforcing this earlier, but
   upon reviewing the situation there are various reasons this isn't
   desirable. We'd rather just force a minor version bump for
   freshly-signed artifacts. Some discussion of the rationale there can
   be found on the clojars-maintainers mailing list if you're interested
   in the background[4].

I've just deployed this change out. Happy to discuss either here or in
the #leiningen channel on Freenode. Hopefully this will have minimal
impact on users, but I felt it was important to mention.

-Phil

[0] - https://groups.google.com/group/clojure/msg/3bec929634bfbe12
[1] - http://straylig.ht/zines/HTP5/0x02_Linode.txt
[2] - Technically this has never been an explicitly documented policy, just
  an undocumented feature.
[3] - 
https://groups.google.com/group/clojars-maintainers/browse_thread/thread/cb9cfc9a366470d7


pgpr7Gx52Fhaz.pgp
Description: PGP signature


Re: [ANN] clojure.java.jdbc 0.3.0 alpha 4

2013-05-13 Thread Michael Klishin
2013/5/14 Sean Corfield 

> http://clojure-doc.org is easy to contribute to so with a bit of
> guidance from that team, perhaps we can start a section there for
> java.jdbc documentation? And maybe move the four pieces of
> documentation above from the contrib repo to the clojure-doc repo?


Feel free to start with a pull request where we can continue discussing
this.

Please try to adapt these documents to the existing guide structure and
style
(core.typed is an OK but not a particularly illustrative example).

I'd be very happy to see clojure.java.jdbc docs on clojure-doc.org. It is
one of the
most useful contrib projects and having a way to easily contributing
documentation for it
would be a major win.
-- 
MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] clojure.java.jdbc 0.3.0 alpha 4

2013-05-13 Thread Michael Klishin
2013/5/14 Sean Corfield 

> I think in-depth documentation for using java.jdbc probably belongs
> somewhere like http://clojure-doc.org - (but I'm not quite sure where
> it belongs on that site)
>

Next to core.typed documentation (which needs some editing to follow the
rest of the guides a bit more closely).
-- 
MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: unusual question: how do you get morale?(or moral support)

2013-05-13 Thread Softaddicts
+1 :)


> I doubt I'm unique in this area, but for me, programming is a drug. I have
> to code, or the ideas and thoughts build up in my mind. For me, actually
> writing down and implementing these is a stress relief. Just ask my parents
> when I was growing up, or my wife today. Keep me in a room without a
> computer for a week, and I'll start writing code on paper just to get the
> thoughts down.
> > So I guess you could say I'm an addict.
> > Timothy Baldridge
> > > On Mon, May 13, 2013 at 12:09 PM, Ulises  wrote:
> > > > Code that matters is code that's used by other people. For me personally
> > > the ability to share my code with others is the thing that makes
> > > programming worth doing in the first place.
> >
> > This is a rather important point. One of the most asked questions
> > (random made up fact) by newcomers to a language is "what can I code?
> > what open source programs can I help?". All with the aims of getting
> > better acquainted with the language itself and, hopefully, helping
> > others. I normally direct people to Advice to Aimless, Excited
> > Programmers (http://prog21.dadgum.com/80.html). For those who'd rather
> > read the rest of this email, the tl;dr version is: got scratch your
> > own itch, you might be building an itch-scratcher for others.
> >
> > The real question now becomes (at least for me): how do you know when
> > an itch is worth scratching? how do you know it's a shared itch?
> >
> > I've seen more experienced programmers immediately recognise what'd be
> > useful at large and what wouldn't (when I presented them with a couple
> > "itches" of my own.) Interestingly enough, my judgement didn't
> > necessarily coincide with theirs.
> >
> > Code to scratch your own itch? Sure, that's great. Code to scratch a
> > shared itch? Even better. But how do you know which is which?
> >
> > U
> >
> > --
> > --
> > 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
> > clojure+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/clojure?hl=en
> > ---
> > You received this message because you are subscribed to the Google Groups
> > "Clojure" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to clojure+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> >
> >
> > > -- > “One of the main causes of the fall of the Roman Empire was 
> > > that–lacking
> zero–they had no way to indicate successful termination of their C
> programs.”
> (Robert Firth)
> > -- > -- > 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
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- > You received this message because you are subscribed to the Google 
> Groups "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> > > --
Softaddicts sent by ibisMail from my ipad!

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ritz-nrepl starts up slowly?

2013-05-13 Thread yizhen wei
I heard using a sdd can reduce the time a lot. Maybe 5x?
Can someone confirm on that?  

On Monday, May 13, 2013 6:17:38 PM UTC-4, Warren Lynn wrote:
>
>
>
>> Is it normal to take this long to start the repl? 
>>
>>
>>
> I don't know if it is normal. But I can confirm it takes much longer to 
> start ritz-nrepl compared to nrepl only, which itself is already kind of 
> slow. The slow speed really is killing a lot of fun here. 
>

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] clojure.java.jdbc 0.3.0 alpha 4

2013-05-13 Thread Sean Corfield
On Mon, May 13, 2013 at 3:01 PM, Gary Deer  wrote:
> What are your plans for documentation beyond the doc strings?

There are some additional documentation pages, based on the doc folder
in the Github repo here:
https://github.com/clojure/java.jdbc/tree/master/doc/clojure/java/jdbc

http://clojure.github.io/java.jdbc/doc/clojure/java/jdbc/UsingSQL.html
http://clojure.github.io/java.jdbc/doc/clojure/java/jdbc/UsingDDL.html
http://clojure.github.io/java.jdbc/doc/clojure/java/jdbc/NameMapping.html
http://clojure.github.io/java.jdbc/doc/clojure/java/jdbc/ConnectionPooling.html

I'm open to suggestions :)

I think in-depth documentation for using java.jdbc probably belongs
somewhere like http://clojure-doc.org - (but I'm not quite sure where
it belongs on that site) - i.e., separate from the core/contrib
reference documentation.

> I've been
> trying to keep track of how I'm using the library and documenting my own use
> cases as much as possible.  I've also dusted off some old database
> programming books to convert some basic java examples to Clojure.  I wish I
> could help out with the effort more, but I'm not as intimate with the code
> base, so at best I can document simple things and at worst document bad
> examples.

http://clojure-doc.org is easy to contribute to so with a bit of
guidance from that team, perhaps we can start a section there for
java.jdbc documentation? And maybe move the four pieces of
documentation above from the contrib repo to the clojure-doc repo?
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] clojure.java.jdbc 0.3.0 alpha 4

2013-05-13 Thread Gary Deer
Tested this one in the real world using an Oracle database: "Address 
JDBC-51 by declaring get-connection returns java.sql.Connection"
indeed it does return a java.sql.Connection

What are your plans for documentation beyond the doc strings?  I've been 
trying to keep track of how I'm using the library and documenting my own 
use cases as much as possible.  I've also dusted off some old database 
programming books to convert some basic java examples to Clojure.  I wish I 
could help out with the effort more, but I'm not as intimate with the code 
base, so at best I can document simple things and at worst document bad 
examples.  

On Monday, May 13, 2013 2:00:31 PM UTC-5, Sean Corfield wrote:
>
> Latest alpha build of the upcoming 0.3.0 release of Clojure's JDBC 
> wrapper contrib library. 
>
> TL;DR: Extensive code changes around connection handling that I'd like 
> to see get tested in the "real world"... 
>
> http://corfield.org/blog/post.cfm/clojure-java-jdbc-0-3-0-alpha-4 
> -- 
> Sean A Corfield -- (904) 302-SEAN 
> An Architect's View -- http://corfield.org/ 
> World Singles, LLC. -- http://worldsingles.com/ 
>
> "Perfection is the enemy of the good." 
> -- Gustave Flaubert, French realist novelist (1821-1880) 
>

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ritz-nrepl starts up slowly?

2013-05-13 Thread Warren Lynn


>
> Is it normal to take this long to start the repl? 
>
>
>
I don't know if it is normal. But I can confirm it takes much longer to 
start ritz-nrepl compared to nrepl only, which itself is already kind of 
slow. The slow speed really is killing a lot of fun here. 

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Utility libraries and dependency hygiene

2013-05-13 Thread fmjrey
Or a reason to integrate via data, not api or type.

On Monday, May 13, 2013 10:54:26 PM UTC+2, Phil Hagelberg wrote:
>
>
> Stuart Sierra writes: 
> > That's cool, and it will work for the simple case of libraries A and B 
> > depending on different versions of C. 
> > 
> > But it still breaks down in more complex cases: e.g. if I want to share 
> > data between A and B using a protocol or type defined in C, and there 
> are 2 
> > incompatible versions of C. Even ClassLoaders can't help you there - I'm 
> > not aware of any solution. 
>
> One of many great reasons not to use protocols and records. =) 
>
> -Phil 
>

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Philip Potter
On 13 May 2013 17:30, Timothy Baldridge  wrote:
>>> In fact, the way that count works on ISeqs is rather roundabout -- it
> only works because all implementations of ISeq in clojure.jar also
> happen to implement java.util.List, so count calls Collection.size().
> In theory, some user-provided ISeq which didn't implement List would
> not respond to count.
>
> --
>
> That is just completely untrue:
>
> https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L536
> https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L826

Thanks for the correction.

I had read this code before and I read it again and couldn't see any
mistake, until I looked at ISeq and realized it implements
IPersistentCollection. That came as a surprise to me.

I guess I'm used to treating seqs and colls as very separate ideas
that I simply didn't expect that ISeq would implement
IPersistentCollection.

Phil

> Timothy
>
>
>
> On Mon, May 13, 2013 at 10:17 AM, Philip Potter 
> wrote:
>>
>> In fact, the way that count works on ISeqs is rather roundabout -- it
>> only works because all implementations of ISeq in clojure.jar also
>> happen to implement java.util.List, so count calls Collection.size().
>> In theory, some user-provided ISeq which didn't implement List would
>> not respond to count.
>>
>> It's probably a good idea for interop reasons to have seqs implement
>> the java collection types, but I don't feel too happy about clojure
>> code which uses the java Collection interface on seqs.
>>
>> Phil
>>
>> On 13 May 2013 15:48, Meikel Brandmeyer (kotarak)  wrote:
>> > Hi,
>> >
>> > Am Montag, 13. Mai 2013 16:16:57 UTC+2 schrieb Sean Corfield:
>> >>
>> >>
>> >> So you think (count (map inc [1 2 3])) should be illegal?
>> >>
>> >> (I'm just trying to understand your logic here)
>> >>
>> >
>> > In the hardcore version, yes. In the practical version, probably not. I
>> > never had to call count on a seq. (Various versions of partition-by or
>> > split
>> > being a notable exception.) (Still a promised O(1) count would be nice
>> > for
>> > reasoning as we have it for contains?. What is clojure.lang.Counted good
>> > for
>> > anyway?)
>> >
>> > Meikel
>> >
>> > --
>> > --
>> > 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
>> > clojure+unsubscr...@googlegroups.com
>> > For more options, visit this group at
>> > http://groups.google.com/group/clojure?hl=en
>> > ---
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Clojure" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > email to clojure+unsubscr...@googlegroups.com.
>> > For more options, visit https://groups.google.com/groups/opt_out.
>> >
>> >
>>
>> --
>> --
>> 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
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>
>
>
> --
> “One of the main causes of the fall of the Roman Empire was that–lacking
> zero–they had no way to indicate successful termination of their C
> programs.”
> (Robert Firth)
>
> --
> --
> 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
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
-- 
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
clojure+unsubsc

Re: unusual question: how do you get morale?(or moral support)

2013-05-13 Thread Zack Maril
One of the reasons I program is because I'm furious. 

By most accepted metrics, I went to one of the best technical public high 
schools in the country. I was average there and I was taking graph theory 
and multivariable calculus as a senior my last semester. The smart kids 
though? They were doing real analysis, topology, and winning international 
competitions for mathematics and science. I'm just finishing up college now 
and I'm watching the geniuses from my high school go from MIT and Stanford 
to high frequency trading firms or work for places like palantir and 
facebook. They're using their gifts to remove liquidity from the 
markets[0], to help fight wars based on lies[1], and to maximize the amount 
of money they can sell my privacy for[2]. Most of them use programming to 
indirectly decrease the quality of my life. I'd love it if I could invest 
money without fear of the markets going crazy because of a tweet[3], if I 
could support the government without worrying about them killing innocent 
citizens[4], and if I could connect with my friends and family without 
worrying about my privacy being sold to the highest bidder. My former 
classmates are and will be using computers to indirectly prevent me from 
doing the above with any sort of peace of mind. It is infuriating. 

When I sit down to program, I now make a conscious effort to build tools 
that I can use in the future to fight against the trends above. I use 
Clojure because it's the language I've been able to get the most done in 
the shortest amount of time. If there were a language that let me do as 
much as fast, I'd drop Clojure like a rock and learn that. If I want to 
stem the negative effects the geniuses are having on my life, I'll need to 
use the best tools possible. That means constantly learning more powerful 
concepts and building better tools. I've been on a graph theory and network 
science kick lately because I noticed that google, palantir, and facebook 
got where they are by virtue of being really good at graph theory. The 
concepts are crazy powerful and provide immense power to the people who can 
successfully employ them. 

So, when I sit down to work on certain projects, the main motivating factor 
for me is that I'm furious that my classmates are worsening my life. 
There's a ton of work that I need to do before I can do anything about it 
though. I'm obviously on a futile crusade fueled by my youth and naiveté, 
but for the moment, that's why I program.  
-Zack

[0] http://www.nanex.net/aqck2/4136.html
[1] http://krugman.blogs.nytimes.com/2013/04/27/the-great-degrader/
[2] https://www.facebook.com/legal/terms
[3] 
http://seekingalpha.com/article/1362731-obama-is-dead-tweet-makes-for-flash-crash
[4] 
http://www.latimes.com/news/opinion/editorials/la-ed-drones-policy-obama-koh-20130513,0,4160911.story

On Monday, May 13, 2013 11:35:33 PM UTC+4, Erlis Vidal wrote:
>
> Let me share this tale with you guys, hope you like it as much as I do: 
>
> It is said that Socrates met a worker who asked: what are you doing good 
> man? "Don't you see I'm cutting a stone to earn my salary and so I can eat
> " the worker replied. He moved on and later found another worker 
> questioning the same way as the previous one, he replied "I'm building a 
> wall," continued Socrates finding their way to a third worker, also 
> questioning, the answer was "I'm building a beautiful palace "
>
>
> On Mon, May 13, 2013 at 2:17 PM, Timothy Baldridge 
> 
> > wrote:
>
>> I doubt I'm unique in this area, but for me, programming is a drug. I 
>> have to code, or the ideas and thoughts build up in my mind. For me, 
>> actually writing down and implementing these is a stress relief. Just ask 
>> my parents when I was growing up, or my wife today. Keep me in a room 
>> without a computer for a week, and I'll start writing code on paper just to 
>> get the thoughts down.
>>
>> So I guess you could say I'm an addict.
>>
>> Timothy Baldridge 
>>
>>
>> On Mon, May 13, 2013 at 12:09 PM, Ulises 
>> > wrote:
>>
>>> > Code that matters is code that's used by other people. For me 
>>> personally
>>> > the ability to share my code with others is the thing that makes
>>> > programming worth doing in the first place.
>>>
>>> This is a rather important point. One of the most asked questions
>>> (random made up fact) by newcomers to a language is "what can I code?
>>> what open source programs can I help?". All with the aims of getting
>>> better acquainted with the language itself and, hopefully, helping
>>> others. I normally direct people to Advice to Aimless, Excited
>>> Programmers (http://prog21.dadgum.com/80.html). For those who'd rather
>>> read the rest of this email, the tl;dr version is: got scratch your
>>> own itch, you might be building an itch-scratcher for others.
>>>
>>> The real question now becomes (at least for me): how do you know when
>>> an itch is worth scratching? how do you know it's a shared itch?
>>>
>>> I've seen more experienced progra

Re: Utility libraries and dependency hygiene

2013-05-13 Thread Phil Hagelberg

Stuart Sierra writes:
> That's cool, and it will work for the simple case of libraries A and B
> depending on different versions of C.
>
> But it still breaks down in more complex cases: e.g. if I want to share
> data between A and B using a protocol or type defined in C, and there are 2
> incompatible versions of C. Even ClassLoaders can't help you there - I'm
> not aware of any solution.

One of many great reasons not to use protocols and records. =)

-Phil


pgpUUtqCHKWCP.pgp
Description: PGP signature


Re: Understanding boxing

2013-05-13 Thread Stuart Sierra
On Tuesday, May 14, 2013 5:36:53 AM UTC+10, puzzler wrote:
> What tools exist in Clojure for understanding whether a
> given variable is boxed or primitive?


The REPL will always box things, making it difficult to use
for understanding primitives.

If you want to be 100% sure, AOT-compile your code and look
at the emitted Java classes with `javap`.

-S

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Utility libraries and dependency hygiene

2013-05-13 Thread Stuart Sierra
On Tue, May 14, 2013 at 3:25 AM, Phil Hagelberg  wrote:

> It's really not difficult to do if you limit yourself to Clojure since
> Clojure namespaces are first-class and easy to manipulate at
> run-time. We implemneted a prototype of this in under two hours at a
> Seajure meeting a while back:
>
> https://github.com/technomancy/metaverse
>
> However, it's significantly more difficult to do for arbitrary Java
> bytecode.
>


That's cool, and it will work for the simple case of libraries A and B
depending on different versions of C.

But it still breaks down in more complex cases: e.g. if I want to share
data between A and B using a protocol or type defined in C, and there are 2
incompatible versions of C. Even ClassLoaders can't help you there - I'm
not aware of any solution.

-S

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Understanding boxing

2013-05-13 Thread Ben Mabey

On Mon May 13 13:36:53 2013, Mark Engelberg wrote:

What tools exist in Clojure for understanding whether a given variable
is boxed or primitive?

To get a better handle on boxing, I started playing around with things
like:

(def x 1)
(def ^int x 1)
(def x (int 1))

I want to know how Clojure is storing that 1 in the various cases.

The only tool I know of to investigate the type of an object is to
call (type x), but type always reports things as boxed, so it is of no
help whatsoever.

How does one go about investigating this?

To be clear, I care less about the actual (def x ...) examples above
(although if you want to comment about that, that's certainly
helpful).  I'm mostly concerned with figuring out how I can explore
these issues on my own.

Thanks,

Mark

--
--
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




In the past I have used this code to help verify that functions are 
returning primitives:


(definterface IPrimitiveTester
 (getType [^int x])
 (getType [^long x])
 (getType [^float x])
 (getType [^double x])
 (getType [^Object x]))

(deftype PrimitiveTester []
 IPrimitiveTester
 (getType [this ^int x] :int)
 (getType [this ^long x] :long)
 (getType [this ^float x] :float)
 (getType [this ^double x] :double)
 (getType [this ^Object x] :object))


(defmacro primitive-type [x]
 `(.getType (PrimitiveTester.) ~x))

(defmacro pt [x]
 `(.getType (PrimitiveTester.) ~x))

;; example use
user=> (defn foo ^long [] 23)
#'user/foo
user=> (pt (foo))
:long

However, I just tried it on your x and I got:

user=> (def ^int x 12)
#'user/x
user=> (pt x)
CompilerException java.lang.IllegalArgumentException: Unable to resolve 
classname: clojure.core$int@1c461984, compiling:(NO_SOURCE_PATH:1)


Hopefully this helps somewhat... I'd be curious if anyone else has a 
good way of doing this.


-Ben

--
--
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups "Clojure" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Utility libraries and dependency hygiene

2013-05-13 Thread zcaudate
I'm guilty of this... But I really don't know what to do I still find 
myself thinking... Hmmm this library provides about 50% of what I want... This 
library has 2 functions that I like And I don't like the way something is 
implemented here... If only i can combine this, this, and this... Oh screw it! 
I'm going to write my own ;)

Any suggestions?

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Understanding boxing

2013-05-13 Thread Mark Engelberg
What tools exist in Clojure for understanding whether a given variable is
boxed or primitive?

To get a better handle on boxing, I started playing around with things like:

(def x 1)
(def ^int x 1)
(def x (int 1))

I want to know how Clojure is storing that 1 in the various cases.

The only tool I know of to investigate the type of an object is to call
(type x), but type always reports things as boxed, so it is of no help
whatsoever.

How does one go about investigating this?

To be clear, I care less about the actual (def x ...) examples above
(although if you want to comment about that, that's certainly helpful).
I'm mostly concerned with figuring out how I can explore these issues on my
own.

Thanks,

Mark

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: unusual question: how do you get morale?(or moral support)

2013-05-13 Thread Erlis Vidal
Let me share this tale with you guys, hope you like it as much as I do:

It is said that Socrates met a worker who asked: what are you doing good man
? "Don't you see I'm cutting a stone to earn my salary and so I can eat" the
worker replied. He moved on and later found another worker questioning the
same way as the previous one, he replied "I'm building a wall," continued
Socrates finding their way to a third worker, also questioning, the answer
was "I'm building a beautiful palace "


On Mon, May 13, 2013 at 2:17 PM, Timothy Baldridge wrote:

> I doubt I'm unique in this area, but for me, programming is a drug. I have
> to code, or the ideas and thoughts build up in my mind. For me, actually
> writing down and implementing these is a stress relief. Just ask my parents
> when I was growing up, or my wife today. Keep me in a room without a
> computer for a week, and I'll start writing code on paper just to get the
> thoughts down.
>
> So I guess you could say I'm an addict.
>
> Timothy Baldridge
>
>
> On Mon, May 13, 2013 at 12:09 PM, Ulises  wrote:
>
>> > Code that matters is code that's used by other people. For me personally
>> > the ability to share my code with others is the thing that makes
>> > programming worth doing in the first place.
>>
>> This is a rather important point. One of the most asked questions
>> (random made up fact) by newcomers to a language is "what can I code?
>> what open source programs can I help?". All with the aims of getting
>> better acquainted with the language itself and, hopefully, helping
>> others. I normally direct people to Advice to Aimless, Excited
>> Programmers (http://prog21.dadgum.com/80.html). For those who'd rather
>> read the rest of this email, the tl;dr version is: got scratch your
>> own itch, you might be building an itch-scratcher for others.
>>
>> The real question now becomes (at least for me): how do you know when
>> an itch is worth scratching? how do you know it's a shared itch?
>>
>> I've seen more experienced programmers immediately recognise what'd be
>> useful at large and what wouldn't (when I presented them with a couple
>> "itches" of my own.) Interestingly enough, my judgement didn't
>> necessarily coincide with theirs.
>>
>> Code to scratch your own itch? Sure, that's great. Code to scratch a
>> shared itch? Even better. But how do you know which is which?
>>
>> U
>>
>> --
>> --
>> 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
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
> --
> “One of the main causes of the fall of the Roman Empire was that–lacking
> zero–they had no way to indicate successful termination of their C
> programs.”
> (Robert Firth)
>
> --
> --
> 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
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[ANN] clojure.java.jdbc 0.3.0 alpha 4

2013-05-13 Thread Sean Corfield
Latest alpha build of the upcoming 0.3.0 release of Clojure's JDBC
wrapper contrib library.

TL;DR: Extensive code changes around connection handling that I'd like
to see get tested in the "real world"...

http://corfield.org/blog/post.cfm/clojure-java-jdbc-0-3-0-alpha-4
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: unusual question: how do you get morale?(or moral support)

2013-05-13 Thread Timothy Baldridge
I doubt I'm unique in this area, but for me, programming is a drug. I have
to code, or the ideas and thoughts build up in my mind. For me, actually
writing down and implementing these is a stress relief. Just ask my parents
when I was growing up, or my wife today. Keep me in a room without a
computer for a week, and I'll start writing code on paper just to get the
thoughts down.

So I guess you could say I'm an addict.

Timothy Baldridge


On Mon, May 13, 2013 at 12:09 PM, Ulises  wrote:

> > Code that matters is code that's used by other people. For me personally
> > the ability to share my code with others is the thing that makes
> > programming worth doing in the first place.
>
> This is a rather important point. One of the most asked questions
> (random made up fact) by newcomers to a language is "what can I code?
> what open source programs can I help?". All with the aims of getting
> better acquainted with the language itself and, hopefully, helping
> others. I normally direct people to Advice to Aimless, Excited
> Programmers (http://prog21.dadgum.com/80.html). For those who'd rather
> read the rest of this email, the tl;dr version is: got scratch your
> own itch, you might be building an itch-scratcher for others.
>
> The real question now becomes (at least for me): how do you know when
> an itch is worth scratching? how do you know it's a shared itch?
>
> I've seen more experienced programmers immediately recognise what'd be
> useful at large and what wouldn't (when I presented them with a couple
> "itches" of my own.) Interestingly enough, my judgement didn't
> necessarily coincide with theirs.
>
> Code to scratch your own itch? Sure, that's great. Code to scratch a
> shared itch? Even better. But how do you know which is which?
>
> U
>
> --
> --
> 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
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: unusual question: how do you get morale?(or moral support)

2013-05-13 Thread Ulises
> Code that matters is code that's used by other people. For me personally
> the ability to share my code with others is the thing that makes
> programming worth doing in the first place.

This is a rather important point. One of the most asked questions
(random made up fact) by newcomers to a language is "what can I code?
what open source programs can I help?". All with the aims of getting
better acquainted with the language itself and, hopefully, helping
others. I normally direct people to Advice to Aimless, Excited
Programmers (http://prog21.dadgum.com/80.html). For those who'd rather
read the rest of this email, the tl;dr version is: got scratch your
own itch, you might be building an itch-scratcher for others.

The real question now becomes (at least for me): how do you know when
an itch is worth scratching? how do you know it's a shared itch?

I've seen more experienced programmers immediately recognise what'd be
useful at large and what wouldn't (when I presented them with a couple
"itches" of my own.) Interestingly enough, my judgement didn't
necessarily coincide with theirs.

Code to scratch your own itch? Sure, that's great. Code to scratch a
shared itch? Even better. But how do you know which is which?

U

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Utility libraries and dependency hygiene

2013-05-13 Thread Phil Hagelberg

Angel Java Lopez writes:

> I guess it could be difficult to implement such feature in Java/Clojure

It's really not difficult to do if you limit yourself to Clojure since
Clojure namespaces are first-class and easy to manipulate at
run-time. We implemneted a prototype of this in under two hours at a
Seajure meeting a while back:

https://github.com/technomancy/metaverse

However, it's significantly more difficult to do for arbitrary Java bytecode.

-Phil


pgpKcBOJ394eb.pgp
Description: PGP signature


Re: FTP with Clojure on Heroku

2013-05-13 Thread Phil Hagelberg

Jonathon McKitrick writes:

> Has anyone had any success accepting FTP uploads in Clojure on Heroku?

Unfortunately Heroku apps are only capable of responding to HTTP
requests at this point.

-Phil


pgp4tO21faepT.pgp
Description: PGP signature


Re: unusual question: how do you get morale?(or moral support)

2013-05-13 Thread Phil Hagelberg

Nelson Morris writes:

> What helps is direct involvement by someone else.

I'll definitely echo this. People are more important than programs.

If I'm writing code that I'm going to be the only one using, maybe it'll
hold my interest for a few hours. But even in the best cases it's
usually only motivated by extreme annoyance, which is not sustainable.

Code that matters is code that's used by other people. For me personally
the ability to share my code with others is the thing that makes
programming worth doing in the first place.

-Phil


pgptQVxRmejyV.pgp
Description: PGP signature


Re: Utility libraries and dependency hygiene

2013-05-13 Thread Dave Ray
On Mon, May 13, 2013 at 1:42 AM, Meikel Brandmeyer (kotarak)
 wrote:
> Hi,
>
> Am Montag, 13. Mai 2013 10:35:14 UTC+2 schrieb Stuart Sierra:
>>
>>
>>
>> I believe "lightweight dependency loading system" is an oxymoron. Either
>> you A) design a new module format and try to get everyone to follow it
>> (OSGI) or B) build an ad-hoc solution that tries to guess at the right
>> behavior (JBoss). Either way, application developers still have a mess to
>> deal with, just with an added layer of complexity.
>>
>> If someone out there can fix this problem once and for all, I will buy you
>> a drink. But you can't bill me for all the drinks you'll need along the way.
>> ;)
>>
>
> Write  a tool which rebases the dependency in your namespace tree. Et voila.
> No nifty class loader magic necessary. As long as you always use *ns* to get
> hold of the namespace name, this should work.
>

In Java-land this tool is called Jar Jar Links
(http://code.google.com/p/jarjar/).

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Timothy Baldridge
>> In fact, the way that count works on ISeqs is rather roundabout -- it
only works because all implementations of ISeq in clojure.jar also
happen to implement java.util.List, so count calls Collection.size().
In theory, some user-provided ISeq which didn't implement List would
not respond to count.

--

That is just completely untrue:

https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L536
https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L826

Timothy



On Mon, May 13, 2013 at 10:17 AM, Philip Potter
wrote:

> In fact, the way that count works on ISeqs is rather roundabout -- it
> only works because all implementations of ISeq in clojure.jar also
> happen to implement java.util.List, so count calls Collection.size().
> In theory, some user-provided ISeq which didn't implement List would
> not respond to count.
>
> It's probably a good idea for interop reasons to have seqs implement
> the java collection types, but I don't feel too happy about clojure
> code which uses the java Collection interface on seqs.
>
> Phil
>
> On 13 May 2013 15:48, Meikel Brandmeyer (kotarak)  wrote:
> > Hi,
> >
> > Am Montag, 13. Mai 2013 16:16:57 UTC+2 schrieb Sean Corfield:
> >>
> >>
> >> So you think (count (map inc [1 2 3])) should be illegal?
> >>
> >> (I'm just trying to understand your logic here)
> >>
> >
> > In the hardcore version, yes. In the practical version, probably not. I
> > never had to call count on a seq. (Various versions of partition-by or
> split
> > being a notable exception.) (Still a promised O(1) count would be nice
> for
> > reasoning as we have it for contains?. What is clojure.lang.Counted good
> for
> > anyway?)
> >
> > Meikel
> >
> > --
> > --
> > 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
> > clojure+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/clojure?hl=en
> > ---
> > You received this message because you are subscribed to the Google Groups
> > "Clojure" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to clojure+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> >
>
> --
> --
> 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
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Philip Potter
In fact, the way that count works on ISeqs is rather roundabout -- it
only works because all implementations of ISeq in clojure.jar also
happen to implement java.util.List, so count calls Collection.size().
In theory, some user-provided ISeq which didn't implement List would
not respond to count.

It's probably a good idea for interop reasons to have seqs implement
the java collection types, but I don't feel too happy about clojure
code which uses the java Collection interface on seqs.

Phil

On 13 May 2013 15:48, Meikel Brandmeyer (kotarak)  wrote:
> Hi,
>
> Am Montag, 13. Mai 2013 16:16:57 UTC+2 schrieb Sean Corfield:
>>
>>
>> So you think (count (map inc [1 2 3])) should be illegal?
>>
>> (I'm just trying to understand your logic here)
>>
>
> In the hardcore version, yes. In the practical version, probably not. I
> never had to call count on a seq. (Various versions of partition-by or split
> being a notable exception.) (Still a promised O(1) count would be nice for
> reasoning as we have it for contains?. What is clojure.lang.Counted good for
> anyway?)
>
> Meikel
>
> --
> --
> 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
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Herwig Hochleitner
2013/5/13 Meikel Brandmeyer (kotarak) 

>
> You misunderstood my argument. cycle returns a sequence => use seq. count
> is the wrong thing to call here. And calling seq without using its return
> value (with a name) is a smell. count should not be called in sequences.
> (In fact I believe that count should be O(1).)
>

Ok, I see the point you're trying to get at. Though I'm
not entirely convinced, that seqs and data structures should be that much
bifurcated. After all seqs _are_ data structures + possible laziness.

I agree that seq should only be called if the result is used as a sequence,
but I also do think it's OK to call collection/data-structure functions on
seqs. There are even optimizations for that:
e.g. (count (seq [1 2 3])) is O(1):
https://github.com/clojure/clojure/blob/1428d43c9a5f9d0e7e89a55707868df76c69d549/src/jvm/clojure/lang/APersistentVector.java#L444

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Christophe Grand
I second: using seq to test for emptiness is only one half of the idiom,
the second half is to bind and to destructure (usually with if-let) the
returned value.

Christophe


On Sat, May 11, 2013 at 12:08 PM, Chris Ford wrote:

> IMHO it's a bit subjective, but empty? is defined as (not (seq coll)), so
> using (not (empty? coll)) is really saying (not (not (seq coll))), which
> feels a bit backwards.
>
> Using seq also plays nicely with if-let:
>
> (if-let [foo (seq "hey")] (print foo))
> (if-let [foo (seq "")] (print foo))
>
> Chris
>
>
> On 11 May 2013 12:48, Kelker Ryan  wrote:
>
>> Here's an example.
>>
>> user=> (if (seq []) (println 1))
>> nil
>> user=> (if (seq [1]) (println 1))
>> 1
>> nil
>>
>>
>> 11.05.2013, 18:40, "Kelker Ryan"
>> > (seq coll) will return a true value if the collection isn't empty. It
>> will also return nil (false) if it is.
>> >
>> > 11.05.2013, 17:37, "Nico Balestra" :
>> >
>> >>  I'm not sure this question has been asked already, but I really want
>> to know the "principle" behind (not (empty? coll)) not being idiomatic.
>> >>
>> >>  I find it much more readable than (seq coll) and I don't understand
>> why (empty?) exists if it's not idiomatic. But my real doubt is:
>> >>
>> >>  What's the "idiom" in (seq coll)?
>> >>
>> >>  Thanks and sorry if the question sounds a bit pedantic :)
>> >>
>> >>  Nico
>> >>
>> >>  "It is better to have 100 functions operate on one data structure
>> than to have 10 functions operate on 10 data structures" - A.J. Perlis
>> >>
>> >>  --
>> >>  --
>> >>  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
>> >>  clojure+unsubscr...@googlegroups.com
>> >>  For more options, visit this group at
>> >>  http://groups.google.com/group/clojure?hl=en
>> >>  ---
>> >>  You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> >>  To unsubscribe from this group and stop receiving emails from it,
>> send an email to clojure+unsubscr...@googlegroups.com.
>> >>  For more options, visit https://groups.google.com/groups/opt_out.
>> >
>> > --
>> > --
>> > 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
>> > clojure+unsubscr...@googlegroups.com
>> > For more options, visit this group at
>> > http://groups.google.com/group/clojure?hl=en
>> > ---
>> > You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an email to clojure+unsubscr...@googlegroups.com.
>> > For more options, visit https://groups.google.com/groups/opt_out.
>>
>> --
>> --
>> 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
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>  --
> --
> 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
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
On Clojure http://clj-me.cgrand.net/
Clojure Programming http://clojurebook.com
Training, Consulting & Contracting http://lambdanext.eu/

-- 
-- 
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 unsubscr

Re: unusual question: how do you get morale?(or moral support)

2013-05-13 Thread Michael Swierczek
On Sunday, May 12, 2013 3:34:22 PM UTC-4, atkaaz wrote:
>
> Hi. I've been meaning to ask (all of)you, how do you get moral support? 
> How do you put yourself into that mood so that you're happy/willing to 
> program? What motivates you to do it? Is it the people you surround 
> yourself with or the financial support? Are they enough to subconsciously 
> motivate you? What if you had no friends/contacts but you had time?
>
>  Unusual question for this ML, I know, so I won't expect (m)any answers. 
> Thanks.
>

This may be tangential to your question - but then maybe it is not:  I 
learned that the better you are at something, the more fun it is.   Playing 
"Mary Had a Little Lamb" on a musical instrument is not that exciting, even 
if it's the first time you managed it.  Playing something from Bach or Led 
Zeppelin is fun.Learning to swim for the first time is not as exciting 
as finishing your first one mile swim.  And the same holds for intellectual 
pursuits.

I had no interest in writing software outside my day job for the first six 
or eight years working.  But through a strange series of events I was 
effectively forced to improve my skills from "able to adequately complete 
assigned tasks" to "competent".  I may be the least skilled person on this 
list, but I'm twice the developer I was ten years ago.  And once I moved 
past basic very minimum competence, I discovered that this work can be 
interesting - more than interesting, it can be entertaining.  

My insight, shamelessly stolen from Cal Newport, is that people don't try 
to find a passion that suits their talent.  That's not now it works.  You 
get so good at something that you enjoy it, and then it becomes your 
passion.  

-Mike

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: prog1

2013-05-13 Thread Christophe Grand
Hi


On Sat, Nov 8, 2008 at 5:10 PM, Robert Pfeiffer <
pfeiffer.rob...@googlemail.com> wrote:

> Is there a benefit in implementing this as a macro instead of a
> function? The function version would be very simple:
>
> (defn returning [returnval & body]
>returnval)
>

The macro does not allocate a sequence of (count body) items.

Christophe

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Gary Trakhman
If there is no one-size fits all solution for your use case, it might
become idiomatic to use a protocol or some other polymorphism. One could
imagine a version of clojure that has protocols for every core function :).

Can you ever have too many cakes to eat them, too?

On Monday, May 13, 2013, Meikel Brandmeyer (kotarak) wrote:

> Hi,
>
> Am Montag, 13. Mai 2013 16:56:11 UTC+2 schrieb tbc++:
>>
>> Let's not forget that allocations on the JVM are super, super cheap. In
>> the order of something like 10 cycles. So don't worry so much about
>> throw-away objects.
>>
>>
> seq involves realization of the first step of the sequence which can be
> arbitrary expensive. allocation < allocation + initialization + realization
>
> Meikel
>
>
> --
> --
> 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 '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
> clojure+unsubscr...@googlegroups.com  'clojure%2bunsubscr...@googlegroups.com');>
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com  'clojure%2bunsubscr...@googlegroups.com');>.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Meikel Brandmeyer (kotarak)
Hi,

Am Montag, 13. Mai 2013 16:56:11 UTC+2 schrieb tbc++:
>
> Let's not forget that allocations on the JVM are super, super cheap. In 
> the order of something like 10 cycles. So don't worry so much about 
> throw-away objects. 
>
>
seq involves realization of the first step of the sequence which can be 
arbitrary expensive. allocation < allocation + initialization + realization

Meikel
 

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Timothy Baldridge
Let's not forget that allocations on the JVM are super, super cheap. In the
order of something like 10 cycles. So don't worry so much about throw-away
objects.

Timothy


On Mon, May 13, 2013 at 8:48 AM, Jim  wrote:

>  So the following is not encouraged because we disregard the result of
> calling seq?
>
> (def dummy
>   {:a [1 2 3]
>:b [4 5 6]
>:c []
>   })
>
> =>(every? seq (vals dummy)) ;make sure all values are non-empty
> false
>
> Jim
>
>
> On 13/05/13 15:08, Meikel Brandmeyer (kotarak) wrote:
>
> Hi,
>
> Am Montag, 13. Mai 2013 13:57:57 UTC+2 schrieb Herwig Hochleitner:
>>
>> 2013/5/13 Meikel Brandmeyer (kotarak) 
>>
>>> seq belongs to seq-land. empty? belongs to data structure land. It
>>> should actually be implemented as #(zero? (count %)). But unfortunately it
>>> is not.
>>>
>>
>>  I'd argue it shouldn't
>>
>>  (empty? (cycle [1 2 3])) => false
>> (zero? (count (cycle [1 2 3]))) ... infinite loop
>>
>
>  You misunderstood my argument. cycle returns a sequence => use seq.
> count is the wrong thing to call here. And calling seq without using its
> return value (with a name) is a smell. count should not be called in
> sequences. (In fact I believe that count should be O(1).)
>
>  (Shameless plug in case it clarifies what I mean:
> http://kotka.de/blog/2010/11/Beware_the_unnamed_seq.html )
>
>  Meikel
>
>  --
> --
> 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
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
>  --
> --
> 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
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Meikel Brandmeyer (kotarak)
Hi,

Am Montag, 13. Mai 2013 16:48:13 UTC+2 schrieb Jim foo.bar:
>
>  So the following is not encouraged because we disregard the result of 
> calling seq?
>

I would prefer (not-any? empty? ...) with empty? being #(zero? (count %)) 
if all the values are data structures. If there might be sequences in 
there, you are in sequence land and should use seq as you did.

But this is just my opinion, which - as you can see - is not mainstream. :)

So don't worry and just use seq (you are on the safe side then, anyway).

Meikel
  

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Jim
So the following is not encouraged because we disregard the result of 
calling seq?


(def dummy
  {:a [1 2 3]
   :b [4 5 6]
   :c []
  })

=>(every? seq (vals dummy)) ;make sure all values are non-empty
false

Jim

On 13/05/13 15:08, Meikel Brandmeyer (kotarak) wrote:

Hi,

Am Montag, 13. Mai 2013 13:57:57 UTC+2 schrieb Herwig Hochleitner:

2013/5/13 Meikel Brandmeyer (kotarak) >

seq belongs to seq-land. empty? belongs to data structure
land. It should actually be implemented as #(zero? (count %)).
But unfortunately it is not.


I'd argue it shouldn't

(empty? (cycle [1 2 3])) => false
(zero? (count (cycle [1 2 3]))) ... infinite loop


You misunderstood my argument. cycle returns a sequence => use seq. 
count is the wrong thing to call here. And calling seq without using 
its return value (with a name) is a smell. count should not be called 
in sequences. (In fact I believe that count should be O(1).)


(Shameless plug in case it clarifies what I mean: 
http://kotka.de/blog/2010/11/Beware_the_unnamed_seq.html )


Meikel

--
--
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google 
Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to clojure+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.




--
--
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups "Clojure" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Meikel Brandmeyer (kotarak)
Hi,

Am Montag, 13. Mai 2013 16:16:57 UTC+2 schrieb Sean Corfield:
>
>
> So you think (count (map inc [1 2 3])) should be illegal? 
>
> (I'm just trying to understand your logic here) 
>
>
In the hardcore version, yes. In the practical version, probably not. I 
never had to call count on a seq. (Various versions of partition-by or 
split being a notable exception.) (Still a promised O(1) count would be 
nice for reasoning as we have it for contains?. What is 
clojure.lang.Counted good for anyway?)

Meikel

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Mark Tomko
Even so, what do you do when you're using someone else's code as a library?


On Mon, May 13, 2013 at 10:42 AM, Meikel Brandmeyer (kotarak)
wrote:

> Hi,
>
> Am Montag, 13. Mai 2013 16:16:36 UTC+2 schrieb Mark:
>>
>> That's a fair point, but do you always know that what you've gotten back
>> is a sequence or a data structure, if you aren't looking directly at the
>> code that you're calling?
>>
>
> Most of my code are either sequence-y things (mostly transformations).
> Then I call seq on the argument and work with the result together with a
> when-let. (maybe transforming things back into the original type of thing
> afterwards) Or it's about data structures. Then - most of the time - you
> have to know anyway what you are working on, because the data structures
> have different usage scenarios.
>
> Typical case:
>
> (into (empty x) (map some-fn (take some-number (filter some-pred x
>
> That said: my code is usually not representative.
>
> Meikel
>
>  --
> --
> 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
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojure/WEoAo6BcCV0/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to
> clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: A JMonkeyEngine3 wrapper?

2013-05-13 Thread Robert Louis McIntyre
Everything's in a mercurial repository here:

http://hg.bortreb.com/cortex/

sincerely, 
--Robert McIntyre

AtKaaZ  writes:

> Robert, do you have all that in a project somewhere on github? I really
> enjoy all the explanations

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Meikel Brandmeyer (kotarak)
Hi,

Am Montag, 13. Mai 2013 16:16:36 UTC+2 schrieb Mark:
>
> That's a fair point, but do you always know that what you've gotten back 
> is a sequence or a data structure, if you aren't looking directly at the 
> code that you're calling?
>

Most of my code are either sequence-y things (mostly transformations). Then 
I call seq on the argument and work with the result together with a 
when-let. (maybe transforming things back into the original type of thing 
afterwards) Or it's about data structures. Then - most of the time - you 
have to know anyway what you are working on, because the data structures 
have different usage scenarios.

Typical case:

(into (empty x) (map some-fn (take some-number (filter some-pred x

That said: my code is usually not representative.

Meikel

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Sean Corfield
On Mon, May 13, 2013 at 7:08 AM, Meikel Brandmeyer (kotarak)
 wrote:
> You misunderstood my argument. cycle returns a sequence => use seq. count is
> the wrong thing to call here. And calling seq without using its return value
> (with a name) is a smell. count should not be called in sequences. (In fact
> I believe that count should be O(1).)

So you think (count (map inc [1 2 3])) should be illegal?

(I'm just trying to understand your logic here)
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Mark
That's a fair point, but do you always know that what you've gotten back is 
a sequence or a data structure, if you aren't looking directly at the code 
that you're calling?

On Monday, May 13, 2013 10:08:00 AM UTC-4, Meikel Brandmeyer (kotarak) 
wrote:
>
> Hi,
>
> Am Montag, 13. Mai 2013 13:57:57 UTC+2 schrieb Herwig Hochleitner:
>>
>> 2013/5/13 Meikel Brandmeyer (kotarak) 
>>
>>> seq belongs to seq-land. empty? belongs to data structure land. It 
>>> should actually be implemented as #(zero? (count %)). But unfortunately it 
>>> is not. 
>>>
>>
>> I'd argue it shouldn't
>>
>> (empty? (cycle [1 2 3])) => false
>> (zero? (count (cycle [1 2 3]))) ... infinite loop
>>
>
> You misunderstood my argument. cycle returns a sequence => use seq. count 
> is the wrong thing to call here. And calling seq without using its return 
> value (with a name) is a smell. count should not be called in sequences. 
> (In fact I believe that count should be O(1).)
>
> (Shameless plug in case it clarifies what I mean: 
> http://kotka.de/blog/2010/11/Beware_the_unnamed_seq.html )
>
> Meikel
>
>

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Meikel Brandmeyer (kotarak)
Hi,

Am Montag, 13. Mai 2013 13:57:57 UTC+2 schrieb Herwig Hochleitner:
>
> 2013/5/13 Meikel Brandmeyer (kotarak) >
>
>> seq belongs to seq-land. empty? belongs to data structure land. It should 
>> actually be implemented as #(zero? (count %)). But unfortunately it is not. 
>>
>
> I'd argue it shouldn't
>
> (empty? (cycle [1 2 3])) => false
> (zero? (count (cycle [1 2 3]))) ... infinite loop
>

You misunderstood my argument. cycle returns a sequence => use seq. count 
is the wrong thing to call here. And calling seq without using its return 
value (with a name) is a smell. count should not be called in sequences. 
(In fact I believe that count should be O(1).)

(Shameless plug in case it clarifies what I mean: 
http://kotka.de/blog/2010/11/Beware_the_unnamed_seq.html )

Meikel

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Meta-eX: Hacking Overtone on the Stubnitz - Thurs 16th May

2013-05-13 Thread Sam Aaron
Hey everyone,

You've heard of people live coding Clojure examples as part of their talks. 
Heck, you've probably even seen Stuart Halloway jam on Chris Ford's Bach 
composition in the new O'Reilly lecture series "Clojure Inside Out". 

However, that's just warm-up material...

Come and jump aboard the M.S. Stubnitz and witness Meta-eX blow your mind with 
some seriously loud hand-hacked beats. Meta-eX is the only Clojure-powered band 
on Earth, and we hack live in Emacs using Overtone to weave immutable data 
structures into ephemeral sounds.

"Our sound isn't hardcore, breakcore or speedcore - it's multi-core and fully 
hyper-threaded."

Meta-eX? http://meta-ex.com
Where? London
When? Thursday 16th of May
Stubnitz? http://ms.stubnitz.com/
Tickets? http://algorave.com/stubnitz2/

Happy Hacking,

Sam

---
http://sam.aaron.name




-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: unusual question: how do you get morale?(or moral support)

2013-05-13 Thread Phillip Lord


AtKaaZ  writes:
> Hi. I've been meaning to ask (all of)you, how do you get moral support? How
> do you put yourself into that mood so that you're happy/willing to program?
> What motivates you to do it? Is it the people you surround yourself with or
> the financial support? Are they enough to subconsciously motivate you? What
> if you had no friends/contacts but you had time?

I have the advantage of not being a programmer; I write code to achieve
something that I want, or that will allow me to answer a question that I
want to answer. As the questions vary, so does the choice of language,
which is why code-wize, I'm a jack-of-all-trades and, indeed, master of
none. 

For me the questions are often biological. How do we measure if two
genes are doing the same thing? How can we we analyse 10,000's of genes
at once? How can we describe the chromosomes that we see down a
microscope?

Of course, you could ask how I find the motivation to answer these
questions; can't tell you that one. I can't understand how anyone could
*not* be interested in how life, how they themselves, work.

So, more generally, my answer is, I care about what my code does;
without this, for me, it's solving a crossword puzzle.

Phil




-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: unusual question: how do you get morale?(or moral support)

2013-05-13 Thread Nelson Morris
Development for money isn't a problem for me, however dev for open source
can be problematic. The scarce resource for open source is mostly time,
though occasionally motivation becomes low. Contributions and projects
start off well, and energy might wane depending on time and life factors.
Even contributing to tools used by many of the members of the community,
like lein and clojars, doesn't prevent it. What helps is direct involvement
by someone else.  Maybe technomancy makes a commit in clojars and it sparks
me there for a couple weeks, or someone will have some problem with lein's
dependency stuff and I'll spend a few days to make it better. Hanging out
in irc sometimes helps, though it can also be a distraction.

Watching the small business software community from afar, I've seen several
people talk about how mastermind groups are helpful. It seems like a weekly
or bi-weekly call/hangout of 3-5 people who provide support and
accountability would be a decent hack for those that need some external
push.



On Sun, May 12, 2013 at 9:02 PM, Sean Corfield wrote:

> +100 :)
>
> I write code because I have to. If my job doesn't have me doing much
> programming, I spin up OSS projects in my spare time. When my job has
> me doing hardcore programming all the time, my urges are satisfied and
> my OSS projects don't get as much love. If my wife's away for the
> weekend, to fill the emptiness, I write code.
>
> My wife has several friends who are writers and artists and they all
> say the same thing: they write (or paint / draw) not because they want
> to, but because they have to - they're driven by some overwhelming
> need or desire.
>
> Like Tim tho', I know a lot of "programmers" who are not like that.
> For them, it's a job. When they go home, they don't think about it,
> they don't read technical books for "fun", they don't write OSS. I'm
> just glad people are willing to pay me for something I'd have to do
> anyway to stay sane...
>
> Sean
>
>
> On Sun, May 12, 2013 at 4:03 PM, u1204  wrote:
> >>Hi. I've been meaning to ask (all of)you, how do you get moral support?
> How
> >>do you put yourself into that mood so that you're happy/willing to
> program?
> >>What motivates you to do it? Is it the people you surround yourself with
> or
> >>the financial support? Are they enough to subconsciously motivate you?
> What
> >>if you had no friends/contacts but you had time?
> >>
> >> Unusual question for this ML, I know, so I won't expect (m)any answers.
> >
> > I can't answer for anyone else but, for me, it is simple.
> > I don't program. I AM a programmer. It is a lot like being an artist,
> > I guess. You see, think, and express in painting. Or a dancer.
> > See Ken Robinson's TED talk and his story about the dancer's education.
> > I see, think, and express myself in programs.
> >
> > I want a program that "speaks the key letter" when I hit a key because
> > it is hard to type while driving. I want it to tell me what letter I
> > just hit so I don't have to look. Driving wastes time.
> >
> > It is Sunday @ 6pm here and I've been coding since I woke up. Prior
> > to that I coded just before I went to sleep (@5am this morning).
> > I program because I breathe?
> >
> > I have a LONG list of programming projects I want to do and not enough
> > time to do them. I'd like to have a group of people who would work with
> > me on them. I've often joked that I'm in the market for a dozen
> > "foreign brides" so I could teach them to program and help. Local laws
> > seem to frown on multiple marriages of convenience unfortunately.
> >
> > I know a lot of people who "program" but I know very few "programmers".
> > They are easy to spot though. Just look for people who get fired up when
> > the watch Rich Hickey's "Are We There Yet" video. Look for someone who
> > thinks McDonalds is the canonical example of an operating system.
> >
> > We live in the first 60 years of a new science. Think big thoughts.
> > Try to throw yourself at a problem that will consume the rest of your
> > life. Think about your craft, understand where it has flaws, and try
> > to convince people there is a better way. Clojure is one example.
> > We won't mention literate programming.
> >
> > Rich is trying to make the language he needs to cleanly express what
> > he wants to do and, as a side effect, he's changing the world around
> > him. You can do that too.
> >
> > Grab the Firefox sources, strip out Javascript, replace it with
> > Clojure. That would completely eliminate the need for ClojureScript and
> > put you dead center in the pantheon of Clojure-ites. If we could open a
> > new browser tab, type Clojure in it, and then use it to drive the GPU
> > graphics hardware to present a new web page... that would be cool. We
> > want to open a Clojure tab and have a REPL.  We want to drag-and-drop
> > the Clojure Ants demo into a tab and see it run immediately, locally,
> > and natively in the browser. Now we have Clojure everywhere on anything
> 

[ANN] - adi 0.1.1 - a `document` database grafted onto Datomic

2013-05-13 Thread zcaudate
I'm extremely happy to announce to the clojure community what I have been 
working on for the past couple of months. I'm calling it `adi`, sanskrit 
for `beginning`, acronym - (A) (D)atomic (I)nterface. 

Get it here: https://github.com/zcaudate/adi

For the more technical minded, these are  features of adi:

   - The Scheme Map and Datomic Schema Emission
   - Key Directory Paths as Map Accessors
   - The Datastore
   - Data Representation and Datomic Data Emission
   - Query Representation and Datomic Query Emission
   - Data Views as Faux `Documents`

For the more airy-fairy, here is the heart-warming version:


adi

adi, rhyming with 'hardy' stands for the acronym (a) (d)atomic (i)nterface.

The concept is simple. adi is a Document Database onto grafted on Datomic. 
It makes use of a map/object notation to interface with a Logical Query 
Engine.

Datomic began something brand new for data, and adi leverages that 
incredible flexiblility with a syntax that is simple to understand. It 
converts flat, record-like arrays to tree-like objects and back again so 
that the user can interface with datomic the way datomic was designed to do.

The key to understanding adi lies in understanding the power of a schema. 
The schema dictates what you can do with the data. Instead of limiting the 
programmer, the schema should exhance him/her.

Using adi once a schema for an application has been defined, the data can 
be inserted in any shape, as long as it follows the coventions specified 
within that schema. Fundamentally, there should be no difference in the 
data-structure between what the programmer asks for and what the programmer 
is getting. We shouldn't have to play around turning objects into records, 
objects into logic queries... etc...

Well... Not anymore...

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Herwig Hochleitner
2013/5/13 Meikel Brandmeyer (kotarak) 

> seq belongs to seq-land. empty? belongs to data structure land. It should
> actually be implemented as #(zero? (count %)). But unfortunately it is not.
>

I'd argue it shouldn't

(empty? (cycle [1 2 3])) => false
(zero? (count (cycle [1 2 3]))) ... infinite loop

This is also a problem for finite seqs, where count is a O(n) operation.
With that in mind, the single seq object allocated by empty? doesn't seem
so bad.

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Meikel Brandmeyer
2013/5/13 Mike Thvedt 

> A good implementation of ISeq won't return a new object, and new
> short-lived objects are cheap on the JVM anyway. OTOH count can be slow for
> some data structures. if you don't like instantiating lots of new objects
> only to throw them away, you're missing out on one of HotSpot's most
> significant performance/convenience sweet spots, so it's strange you call
> that premature optimization.
>
> There is however an optimization story against seq: Hotspot (at least on
> my machine) refuses to inline the call to seq by default (it might still
> inline if the stars are right or something, the JVM is mysterious). My
> guess is it's because the code in seq and seqFrom is too big, on my box it
> exceeds the inline threshold by one byte...
>
>
I'm not sure what you mean. For an ISeq seq won't return a new object.  But
for everything else it will. And count is cheap (a simple field access) for
clojure data structures (a seq is not a data structure). While initialising
an immediately-to-be-thrown-away object might be (relatively) expensive
even when allocation is cheap.

I called my point of view "premature optimisation" because it's probably
like you said: allocation is cheap and initialisation usually not worth
worrying about. So worrying about it is "premature optimisation".

I still feel empty? to be too ugly in its current implementation. (And to
be honest: I almost never needed it, up to now...)

Meikel

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Mike Thvedt
A good implementation of ISeq won't return a new object, and new 
short-lived objects are cheap on the JVM anyway. OTOH count can be slow for 
some data structures. if you don't like instantiating lots of new objects 
only to throw them away, you're missing out on one of HotSpot's most 
significant performance/convenience sweet spots, so it's strange you call 
that premature optimization.

There is however an optimization story against seq: Hotspot (at least on my 
machine) refuses to inline the call to seq by default (it might still 
inline if the stars are right or something, the JVM is mysterious). My 
guess is it's because the code in seq and seqFrom is too big, on my box it 
exceeds the inline threshold by one byte...

On Monday, May 13, 2013 1:32:09 AM UTC-5, Meikel Brandmeyer (kotarak) wrote:
>
> Hi,
>
> Am Samstag, 11. Mai 2013 21:25:11 UTC+2 schrieb Alex Baranosky:
>>
>> Most of the code I see and write at work at Runa uses (not (empty? foo)). 
>>  I'll continue to defend the position that it is more obvious code, and 
>> therefore better (imo :) )
>>
>>
> seq belongs to seq-land. empty? belongs to data structure land. It should 
> actually be implemented as #(zero? (count %)). But unfortunately it is not. 
> Maybe I'm to green (and too much a premature optimiser) , but I don't like 
> allocating and initialising a new object just to throw it away immediately.
>
> Meikel
>
>

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Utility libraries and dependency hygiene

2013-05-13 Thread Glen Mailer
Are dependencies the potential problem, or are "utility belt" dependencies 
the issue here?

If its the latter, then should we be trying to break down the utility belt 
into groups of related functionality, which can be stable and focused.

Promoting zero-dependency libraries just means re-inventing a bunch of 
wheels, I believe node.js has this right by making dependencies cheap and 
easy and promoting publishing reusable libraries with only a few functions 
in. Not being able to load multiple versions of the same dependency make 
this slightly harder, but the general goal appears to me to be a good one.

Glen

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Utility libraries and dependency hygiene

2013-05-13 Thread Meikel Brandmeyer (kotarak)
Hi,

Am Montag, 13. Mai 2013 10:35:14 UTC+2 schrieb Stuart Sierra:
>
>
>
> I believe "lightweight dependency loading system" is an oxymoron. Either 
> you A) design a new module format and try to get everyone to follow it 
> (OSGI) or B) build an ad-hoc solution that tries to guess at the right 
> behavior (JBoss). Either way, application developers still have a mess to 
> deal with, just with an added layer of complexity.
>
> If someone out there can fix this problem once and for all, I will buy you 
> a drink. But you can't bill me for all the drinks you'll need along the 
> way. ;)
>
>
Write  a tool which rebases the dependency in your namespace tree. Et 
voila. No nifty class loader magic necessary. As long as you always use 
*ns* to get hold of the namespace name, this should work.

Meikel

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Utility libraries and dependency hygiene

2013-05-13 Thread Stuart Sierra
On Mon, May 13, 2013 at 12:55 PM, Mikera wrote:

> Maybe we could try to develop towards some kind of lightweight dependency
> loading system that avoids this problem?



I believe "lightweight dependency loading system" is an oxymoron. Either
you A) design a new module format and try to get everyone to follow it
(OSGI) or B) build an ad-hoc solution that tries to guess at the right
behavior (JBoss). Either way, application developers still have a mess to
deal with, just with an added layer of complexity.

If someone out there can fix this problem once and for all, I will buy you
a drink. But you can't bill me for all the drinks you'll need along the
way. ;)

-S

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Utility libraries and dependency hygiene

2013-05-13 Thread Alex Baranosky
Yes, by all means please just copy-n-paste out of
https://github.com/runa-dev/kits if it simplifies your dependency tree.

On Sun, May 12, 2013 at 8:53 PM, Dave Kincaid wrote:

> Thanks for this, Stuart. I hope it's not too late. As one who has spent
> the last couple weeks spinning up a new project that uses its own local Ivy
> repository I've been feeling this pain first hand. The number of
> dependencies I have had to add just for a few Clojure libraries has been
> quite painful. I attributed it to how young the language is that these
> utility libraries haven't had time to consolidate.
>
>
> On Sunday, May 12, 2013 6:29:28 PM UTC-5, Stuart Sierra wrote:
>>
>> Based on a recent thread about "utility" libraries, I would like to
>> take this opportunity to ask everyone to help us avoid the dependency
>> mess that Common Lisp has gotten into, where there are over a dozen
>> such "convenience" libraries[1].
>>
>> By all means, use these libraries in your *applications* if you find
>> them useful. But please don't make your *libraries* depend on them
>> unless you really need to.
>>
>> Doing this will help application developers who want to use your
>> library. For example, if my application depends on libraries A, B, and
>> C, I might end up with transitive dependencies on three different
>> "utility" libraries. If I want to add library D which depends on an
>> incompatible version of one of those utilities, I'm stuck. By
>> adding to the dependencies of your library, you increase the
>> likelihood of dependency conflicts for consumers.
>>
>> The ideal number of dependencies for a library release (not counting
>> Clojure itself) is zero. Obviously, use common sense. If your library
>> relies on critical functionality in another library, then make the
>> dependency. But if you can get by without the dependency (even if that
>> means copying some of those "utility" functions into your own code and
>> making them private) then you will make life easier for consumers of
>> your library.
>>
>> Thanks, and happy coding.
>> -S
>>
>>
>> [1]: 
>> http://cliki.net/Convenience%**20library
>>
>  --
> --
> 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
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.