What about putting array.empty in object.d?

Jonathan M Davis jmdavisProg at gmx.com
Wed Mar 21 13:49:24 PDT 2012


On Wednesday, March 21, 2012 10:17:08 Jacob Carlborg wrote:
> On 2012-03-21 09:42, Nick Sabalausky wrote:
> > "Jacob Carlborg"<doob at me.com> wrote in message
> > 
> >> Sure, why not. Do we want an "any" function as well, that is the
> >> opposite?
> > 
> > I think "!array.empty" is plenty sufficient. Besides, there are other good
> > uses of "any" that have been brought up before.
> 
> Actually I was thinking something like "any?" in Ruby:
> 
> http://www.ruby-doc.org/core-1.8.7/Enumerable.html#method-i-any-3F

So, std.algorithm.canFind then? There has been some discussion of renaming it 
to any (or at least the overload that just takes the predicate and the range), 
but canFind gives you the behavior regardless.

- Jonathan M Davis


More information about the Digitalmars-d mailing list