On 20 October 2014 12:23, Phillip Lord <phillip.l...@newcastle.ac.uk> wrote:

> James Reeves <ja...@booleanknot.com> writes:
>
> > Yes, Clojure pretty much rejects the idea of uniform access.


> I don't think it does. I think it just does not support it which is a
> somewhat different thing.
>

I thought it was pretty clear that Clojure prefers data over APIs. The
uniform access principle is about preferring APIs over data, which seems
counter to Clojure's ideology.


Still, although my example might appear irrelevant to Clojure in
> general, I don't think it is. Clojure's current docstring support is not
> very good (and there was a thread here about it not long ago). It would
> be nice to have something richer. For really rich documentation,
> maintaining the docstrings is a different file might make sense. Clojure
> can support this at the moment, but only in the way that I have -- the
> var metadata could be updated at load time. What it cannot do (easily)
> is support lazy loading of the file documentation at the point of first
> use, because the decision was made originally that :doc metadata is a
> value and is NOT computed.
>

There's no reason why you have to use the :doc metadata for that. Just
write another function that takes a var and spits out some documentation.


On 20 October 2014 12:26, Phillip Lord <phillip.l...@newcastle.ac.uk> wrote:

> > The largest systems we've developed, including the web itself, are data
> > driven.
>
> Interesting. So, if you resolve http://www.clojure.org, is this data or
> is it computed?
>
> I don't think you can tell. The web supports the Uniform Access
> Principle.


The response may be computed, but once it's sent to the client it's
immutable data. The response returned has no inherent API associated with
it.

To put it another way, consider the function:

    (defn build-user [first-name last-name]
      {:first-name first-name
       :last-name last-name
       :full-name (str first-name " " last-name)})

Like a website, a function may perform computations, but its return value
is immutable data. Would you say the above conforms the the Uniform Access
Principle?

- James

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