[m-rev.] for review: Add det_take to the list module

Julien Fischer jfischer at opturion.com
Thu Dec 26 12:07:18 AEDT 2013



On Wed, 25 Dec 2013, Paul Bone wrote:

> On Mon, Dec 23, 2013 at 05:26:32PM +1100, Julien Fischer wrote:
>> On Sat, 21 Dec 2013, Paul Bone wrote:
>>
>>> Branches: master
>>>
>>> For review by anyone
>>>
>>> Add det_take to the list module
>>>
>>> The list module currently contains take, drop and det_drop predicates, but
>>> no det_take predicate.  Developers could use det_split_list instead, however
>>> det_take is more straight-forward and can be expected to exist since
>>> det_drop exists.
>>>
>>> library/list.m:
>>>    As above.
>>>
>>> NEWS:
>>>    Announce the new predicate.
>>> ---
>>
>>
>>> diff --git a/library/list.m b/library/list.m
>>> index d3f1856..8298ece 100644
>>> --- a/library/list.m
>>> +++ b/library/list.m
>>> @@ -232,12 +232,19 @@
>>> :- pred list.split_upto(int::in, list(T)::in, list(T)::out, list(T)::out)
>>>     is det.
>>>
>>> -    % list.take(Len, List, Start):
>>> +    % take(Len, List, Start):
>>
>> Any reason you deleted the module qualifier there?  The style used in
>> the rest of this module is to have the qualifier present.  (I wouldn't
>> go around changing it unless you change the rest of the module to
>> maintain consistency -- better still, since this not consistent across
>> all the stdlib modules would be to extend the ``Standard Library'' bit
>> of the coding standard first ...)
>
> I deleted the qualifiers to update this part of this module to the newer
> style used in the rest of the system.  I can change the rest of the module
> if desired, I don't mind.
>
> Okay, I guess I'll update the style throughout the library.

I wouldn't touch any of it until there *is* an agreed style; in the
meantime I suggest just sticking to the whatever style is used within
the module in question.

Cheers,
Julien.



More information about the reviews mailing list