Seems to work for me:
user=> (make-user-nice-name { :username "bazookajoe"})
"bazookajoe"
user=> (make-user-nice-name {:first_name "Joe" :username "bazookajoe"})
"bazookajoe"
user=> (make-user-nice-name {:first_name "Joe" :last_name "Blow" :username
"bazookajoe"})
"Joe Blow"
user=> (make-user-nice-name {:first_name "Joe" :last_name "Blow"})
"Joe Blow"
# This is the only suspicious behavior, but it's doing what you asked it to
user=> (make-user-nice-name {:first_name "Joe"})
nil
On Fri, Jan 4, 2013 at 11:12 PM, larry google groups <
[email protected]> wrote:
>
> This function gives me a nicely formatted name if the user has supplied a
> first_name or a last_name, however, if there is no first_name and no
> last_name then I get nothing at all. But the username is there in the
> record. Can someone tell me what I did wrong? Why is the username not
> getting set as the value of user-nice-name?
>
>
> (defn make-user-nice-name [map-of-profile]
> (let [user-nice-name
> (if-not (or (nil? (:first_name map-of-profile)) (nil? (:last_name
> map-of-profile)))
> (apply str (:first_name map-of-profile) " " (:last_name
> map-of-profile))
> (:username map-of-profile))]
> user-nice-name))
>
> --
> 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 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