26 Sep '12, 1am

Replacing Common Code With clojure.set Function Calls

If you've written a fair amount of Clojure code and aren't familiar with clojure.set, then chances are you've probably reinvented a few functions that are already available in the standard library. In this blog post I'll give a few examples of commonly written code, and I'll show the clojure.set functions that already do everything you need. Removing elements from a collection is a very common programming task. Sometimes the collection will need to be a vector or a list, and removing an element from the collection will look similar to the example below. user=> (remove #{1 2} [1 2 3 4 3 2 1]) (3 4 3) In the cases where you're starting with a list and you want to return a seq, remove is a good solution. However, you may also find yourself starting with a set or looking to return a set. If you're starting with sets, you'll probably get a performance gain by using clojure.set/...

Full article: http://blog.jayfields.com/2012/09/replacing-common-code-w...

Tweets

Morse code on Earth: via @ednmagazine

edn.com 27 Sep '12, 12am

Morse code being laid down on Mars by the Curiosity Rover’s tire treads. I got a couple of messages on the theme of “Morse...

A common dietary problem ... (Take a look at yo...

news.runnersworld.com 29 Sep '12, 10pm

A short article, right to the point. Staying within the salt guidelines is very hard for sure. I cut out deli meat mainly ...

How to Set Up the New Universal Google Remarket...

searchenginewatch.com 27 Sep '12, 1pm

With Google launching an easier to implement, more feature-enabled version of their remarketing code, now it’s easy for ad...

5 Common Drugs That May Be Making You Sicker

5 Common Drugs That May Be Making You Sicker

care2.com 29 Sep '12, 12am

We’ve grown accustomed to taking pills when we feel bad–for headaches, insomnia, mild depression, indigestion, and the ach...

In some countries, eating snakes are as common as eating kway chap is to us. Would you dare to try any of these...

In some countries, eating snakes are as common ...

soshiok.com 30 Sep '12, 5am

Coming from Singapore, we have a wide variety of food from different cultures. It is as normal to order pig's organs soup ...