Is str ~ regex the root of all evil, or the leaf of all good?

Bill Baxter wbaxter at gmail.com
Thu Feb 19 17:19:03 PST 2009


On Fri, Feb 20, 2009 at 9:47 AM, KennyTM~ <kennytm at gmail.com> wrote:
> Bill Baxter wrote:
>>
>> I don't like the syntax I saw somewhere earlier in the thread of
>>    0..iter.captures
>>
>> .captures looks like it should be a set of captures, not a count.
>>
>> This is a need that comes up again and again -- querying the size, or
>> count, or length of some sub-element like this -- so I think it would
>> greatly benefit Phobos to choose some less ambiguous convention and
>> stick to it.   Like  nCaptures, numCaptures, capturesLength, etc.
>>
>> ---bb
>
> iter.count

Maybe I haven't paid close enough attention here, but I think the
reason he didn't say .count or .length is that it's ambiguous whether
it means the number of captures or the number of matches.

--bb



More information about the Digitalmars-d mailing list