[m-rev.] for review: discrete interval encoding tree

Julien Fischer jfischer at opturion.com
Tue Mar 4 14:33:09 AEDT 2014


On Tue, 4 Mar 2014, Peter Wang wrote:

> On Mon, 3 Mar 2014 15:35:57 +1100 (EST), Julien Fischer <jfischer at opturion.com> wrote:
>>>>> +:- func det_from_int(int) = T <= enum(T).
>>>>> +
>>>>> +det_from_int(I) = X :-
>>>>> +    ( X0 = from_int(I) ->
>>>>> +        X = X0
>>>>> +    ;
>>>>> +        unexpected($module, $pred, "from_int failed")
>>>>> +    ).
>>>>
>>>> Move this to the enum module.
>>>
>>> Are you sure?  I think enum should stay minimal.
>>
>> It's an obvious utility predicate that the enum module ought to provide.
>> (I've certainly wanted it in the past when I used the enum type class
>> and the fact that you've required here suggests that it is something the
>> enum modue should provide.)
>
> Alright.  It does lose the more specific error message, though.

That's true for almost every det_* procedure in the library.

Cheers,
Julien.



More information about the reviews mailing list