11 Jun '12, 2pm

Clojure: name function

The 'name' function is a clojure function that returns the string for a keyword, symbol, or string. name - function Usage: (name x) Returns the name String of a string, symbol or keyword. At first glace this might not seem that interesting; however, it's good to know 'name' if you've ever been surprised by (str :foo) => ":foo". If you have a ruby background (as I do), you probably expected the result to be "foo", spent a bit of time looking, and found that (name :foo) was actually what you were looking for. That's helpful, but not particularly exciting. Perhaps a more interesting application of name is the ability to normalize all keys as strings and destructure . For example, say you're designing a library that monitors threads and you want to be able to pass in warning and error thresholds. Usage of your functions may look like the following examples (monitored-threads/c...

Full article: http://blog.jayfields.com/2012/06/clojure-name-function.html

Tweets

Clojure: expectations & with-redefs

blog.jayfields.com 05 Jun '12, 1pm

In general, when I'm writing tests, the pure functions end up as bare expects and the impure functions end up as scenarios...

Clojure: Freezing Time in expectations

blog.jayfields.com 29 May '12, 1pm

The current version of expectations (1.4.3) contains support for freezing time within an expectations scenario . I already...

Jay Fields' Thoughts: Clojure: Production Web REPL

blog.jayfields.com 21 Jun '12, 11am

is a powerful tool. I use the REPL extensively in development, and I recently added a web REPL to each of our production a...

+1 I still hate weekend conferences:

blog.jayfields.com 09 Jun '12, 12pm

I have a personal hatred for weekend conferences*. To me, a weekend conference ensures that I'll be "working" for 12 strai...

Thoughts: Happy

xinyun.sg 16 Jun '12, 9pm

What does it take to obtain or to be happy? Not much. The willingness to see things in a different light, from others’ poi...

BALKANS: War Crimes, Genocide And Name Games

strategypage.com 09 Jun '12, 9am

June 9, 2012: Turkey announced that it will give the Tunisian government $100 million. The money is for economic and socia...

Jay Fields' Thoughts: speaking at speakerconf

blog.jayfields.com 07 Jun '12, 1pm

Speaking at speakerconf is nothing like speaking at a traditional conference. It took us a few years to tweak our ideas ar...