Almost all of Clojure's reader macros are prefix driven. For example, 'foo
quotes the symbol "foo", a string "foo" starts with a prefix quote and
terminates with another string. Same for lists (prefixed with a
parentheses), vectors, maps, etc. Even var literals #'my-var are prefixed.
So it's very natural to keep keywords the same way. The syntax (I think)
comes from Ruby although they call keywords "symbols".

So that would be my rationale for it..it's easy to see by the first
character of a term what data structure the term will become (
https://en.wikibooks.org/wiki/Learning_Clojure/Reader_Macros). And that's
just one of many reasons (without even mentioning backwards compatibility),
postfix colons on keywords will never happen.

Hope that helps a bit, it may take a bit to get used to the syntax, but
it'll come with time. Welcome to Clojure, by-the-way.

Timothy

On Fri, Sep 23, 2016 at 2:07 PM, <tabcomput...@gmail.com> wrote:

> The last four days have been in exercise in frustration as I have tried
> four different static site generators, all of which gave me serious fits
> with one exception: Cryogen.* That has led me consider that it might be a
> good time to dive into Clojure. Though I am new to Clojure, I've been
> eyeing it for some time. Reading over numerous examples, there is one thing
> about reading Clojure code that I find a bit hard to take -- keywords. Take
> the example of metadata for a Cryogen post:
>
>     {:title  "First Post!"
>      :layout :post
>      :date   "2016-01-01"
>      :tags   ["tag1" "tag3"]}
>
>
> It's perfectly understandable, of course, but I can't help but feel a gut
> reaction that is should be:
>
>     {title:  "First Post!"
>      layout: :post
>      date:   "2016-01-01"
>      tags:   ["tag1" "tag3"]}
>
>
> And this is true for what seem to be most uses of keywords. Another
> example:
>
>     (client/get "http://example.com";
>       {:headers {:foo ["bar" "baz"], :eggplant "quux"}})
>
>
> would just read so much better as:
>
>     (client/get "http://example.com";
>       {headers: {foo: ["bar" "baz"], eggplant: "quux"}})
>
>
> So I was wondering, is there any reason Clojure couldn't *also* support
> keywords with a backside colon notation?
>
>
> *I had only one issue with Cryogen, for which the error message was
> completely useless. But I was able to work out that I was missing a
> `:layout` in a post's metadata.
>
> --
> 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/d/optout.
>



-- 
“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/d/optout.

Reply via email to