Unless of course your whole example was to work with Protocols (he says as
he notices the file is called protocols.clj in a protocols namespace) in
which case - yep, that is fine :).
On Monday, 23 February 2015 19:51:00 UTC, Colin Yates wrote:
>
> A minor point (get col n) is the same as (col n).
>
> It's more of a stylistic thing, but your use of protocols and
> implementation is quite 'stateful'. I would have done the same with
> vanilla maps:
>
> (def employee [first-name last-name level]
> {:first-name .....})
>
> (defn promote [{:keys [level] :as employee]
> (assoc employee :level (next-item levels level)))
>
> but that is just me - maybe I ran too far from the OO world....
>
> On 23 February 2015 at 18:44, Daniel Hinojosa
> <[email protected]> wrote:
> > This is for my language matrix project that has samples for 10 different
> > languages. My clojure knowledge is ok, but not really as great where I
> > would like it to be, therefore looking towards the community for help.
> >
> > This example works, but it still has the feel of a lot of duplication,
> are
> > there any refactorings that I can do to this to make it more concise?
> >
> >
> https://github.com/dhinojosa/language-matrix/blob/master/clojure/protocols/protocols.clj
>
> >
> > Thank you in advance,
> >
> > Danno
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Clojure" group.
> > To post to this group, send email to [email protected]
> > Note that posts from new members are moderated - please be patient with
> your
> > first post.
> > To unsubscribe from this group, send email to
> > [email protected]
> > 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 [email protected].
> > For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.