clojuredesign-podcast

Discussions around the Functional Design in Clojure podcast - https://clojuredesign.club/
jumar 2019-10-11T18:57:17.001600Z

I think Chris mentioned recently there's no short way how to get namespace of a keyword. Maybe I'm misinterpreting him but if not then there's the the namespace function:

(namespace :ahoj/key)
;;=> "ahoj"

neumann 2019-10-14T17:46:01.006400Z

Sounds like I wasn't totally clear. I was trying to say, there isn't a short way to get a string for a keyword that includes the namespace.

neumann 2019-10-14T17:46:26.007Z

When I want :foo/bar to become "foo/bar".

neumann 2019-10-14T17:47:54.007300Z

The best way I've found thus far is:

user=> (subs (str :foo/bar) 1)
"foo/bar"

neumann 2019-10-14T17:48:26.007500Z

Because:

user=> (str :foo/bar)
":foo/bar"

jrwdunham 2019-10-20T12:01:27.066Z

(->> :foo/bar ((juxt namespace (constantly \/) name)) (apply str))

jrwdunham 2019-10-20T12:03:49.066200Z

because baroque

neumann 2019-10-21T15:35:15.070100Z

@jrwdunham That's fun! And yes, baroque. πŸ™‚

πŸ‘ 1
spfeiffer 2019-10-11T19:09:32.002600Z

BTW, Gene Kim (The Phoenix Project) recommends the podcast: https://itrevolution.com/love-letter-to-clojure-part-1/ (Near the end)

neumann 2019-10-14T17:49:14.007700Z

@spfeiffer Thanks for the heads up! That's a great read!

genekim 2019-10-15T15:19:29.041500Z

Thanks for the kind words, all! I can’t overstate how fantastic @nate your work has been in helping me understand and better use Clojure β€” keep up all the amazing work!

neumann 2019-10-15T15:52:41.054Z

@genekim Thank you so much! Hearing that is huge for me!

nate 2019-10-11T22:55:29.002800Z

Oh wow, that's great!

nate 2019-10-11T22:55:59.003Z

Many many words, I'll have to read it this evening. Thanks for the tip @spfeiffer