Note that there is precedent for this in clojure.string/blank?
<http://clojuredocs.org/clojure.string/blank_q>.
​

On Wed, Dec 24, 2014 at 7:58 AM, Andrey Antukh <n...@niwi.be> wrote:

> Hi!
>
> Thank you very much!
>
> You are right about nil handling, it should be documented and proper
> handled.
>
> But I'm not completely convinced with ruby behavior for that, in many
> other implementations in other languages it is slightly different.
>
> In my opinion that is more proper behavior:
>
> blank? (nil, whitespace chars resolves to true, something else, false)
> empty? (nil and "" (empty string) resolves to true, something else is
> false)
> the purposed whitespace? is synonym of blank?
>
> I'll document and add tests for it in next days.
>
> Again, thanks for the feedback.
>
> Cheers.
> Andrey
>
> 2014-12-24 13:03 GMT+01:00 Sean Johnson <belu...@acm.org>:
>
>> Very nice work. I'll be using this!
>>
>> Also, I agree with Noam that there's a fairly common expectation of
>> blank? that started in the Ruby world.
>>
>> Here's my suggestion for what it's worth:
>>
>> blank? - true iff "" or nil
>> empty? - true iff "", false if nil
>> whitespace? true iff "" or only white space, false if nil
>>
>> Cheers,
>> Sean
>>
>> On Tuesday, December 23, 2014 12:48:35 PM UTC-5, Andrey Antukh wrote:
>>>
>>> Hello everybody.
>>>
>>> I wanted to announce the first release of cuerdas. A string manipulation
>>> library for clojure and clojurescript.
>>>
>>> It is mainly based on underscore.string and string.js, but also
>>> influenced by lodash.
>>>
>>> Documentation: http://funcool.github.io/cuerdas/latest/
>>> Github: https://github.com/funcool/cuerdas
>>>
>>> Cheers.
>>> Andrey
>>>
>>> --
>>> Andrey Antukh - Андрей Антух - <andrei....@kaleidos.net> / <
>>> ni...@niwi.be>
>>> http://www.niwi.be <http://www.niwi.be/page/about/>
>>> https://github.com/niwibe
>>>
>>  --
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "ClojureScript" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojurescript+unsubscr...@googlegroups.com.
>> To post to this group, send email to clojurescr...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/clojurescript.
>>
>
>
>
> --
> Andrey Antukh - Андрей Антух - <andrei.anto...@kaleidos.net> / <
> n...@niwi.be>
> http://www.niwi.be <http://www.niwi.be/page/about/>
> https://github.com/niwibe
>
> --
> 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.
>

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