Formal Review of std.regex (FReD)

Dmitry Olshansky dmitry.olsh at gmail.com
Mon Oct 10 06:45:51 PDT 2011


On 09.10.2011 22:47, Jacob Carlborg wrote:
> On 2011-10-09 17:29, Dmitry Olshansky wrote:
>> On 09.10.2011 19:09, Jacob Carlborg wrote:
>>> On 2011-10-09 17:01, Dmitry Olshansky wrote:
>>>> On 09.10.2011 18:49, Jacob Carlborg wrote:
>>>>> On 2011-10-09 16:09, Dmitry Olshansky wrote:
>>>>>> On 09.10.2011 14:33, Jacob Carlborg wrote:
>>>>>>> On 2011-10-08 21:56, Jesse Phillips wrote:
>>>>>>>> Hello everyone,
>>>>>>>>
>>>>>>>> I have taken the role of review manager of the std.regex
>>>>>>>> replacement by
>>>>>>>> Dmitry Olshansky. The review period begins now 2011-10-8 and will
>>>>>>>> end on
>>>>>>>> 2011-10-23 at midnight UTC. A voting thread to include into Phobos
>>>>>>>> will
>>>>>>>> be held after review assuming such is appropriate. The Voting
>>>>>>>> period is
>>>>>>>> one week.
>>>>>>>>
>>>>>>>> Please note that you can try FRed as part of Phobos (Code) or by
>>>>>>>> itself
>>>>>>>> (Package of FReD) which includes docs.
>>>>>>>>
>>>>>>>> Doc:
>>>>>>>>
>>>>>>>> http://nascent.freeshell.org/fred/doc/
>>>>>>>
>>>>>>> What's the difference between Regex and RegEx? I can see RegEx in
>>>>>>> the
>>>>>>> documentation but I cannot find its definition in the docs.
>>>>>>>
>>>>>>
>>>>>> RegEx is a template parameter (it's that usual abstract 'T'), that in
>>>>>> the end deduced as StaticRegex!Char or Regex!Char where Char is
>>>>>> char/wchar/dchar.
>>>>>
>>>>> I don't think the documentation should refer to RegEx if it's not
>>>>> defined in the docs.
>>>>>
>>>> Yes, I think I see the typo now, thanks.
>>>
>>> The second parameter type of the match function (and a couple of other
>>> functions) is RegEx, is that possible to fix as well?
>>>
>>
>> No, that's what I tried to point out but failed obviously.
>> The thing is that it is a templated parameter and due to constraint it
>> could be either StaticRegex!Char or Regex!Char. They represent pattern
>> compiled as machine code or bytecode respectively for character width of
>> Char. All of the 6 versions of compiled patterns in the end do not have
>> a common type nor one is technically possible (w/o some quite bad
>> performance trade offs).
>
> Aha, ok, I see. Could RegEx be explained in the docs so it won't cause
> further confusion?
>
Mm... it could get even more confusing.
I guess putting "The RegEx parameter can be either Regex!Char or 
StaticRegex!Char depending on the actual type of pattern passed" all 
over the place won't cut it. Placing it somewhere on the top has 
disadvantage of lacking any prior context, and most users will miss it 
anyway.
Maybe I'll just add Params: section with short description to all 
functions that still lack one.

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list