SWI-Prolog / issues

Dummy repository for issue tracking
7 stars 3 forks source link

char_type/2 non-relational #130

Closed UWN closed 11 months ago

UWN commented 11 months ago
?- char_type(C,to_upper(a)).
C = 'A'.

?- char_type(C,to_upper(a)), C = a.
false.

?- C = a, char_type(C,to_upper(a)).
C = a, unexpected.

version 9.1.17

JanWielemaker commented 11 months ago

The to_upper and to_lower are intended to be used as char_type(+C, to_lower(-Upper)) where both the lower and uppercase letter are mapped to the uppercase. Also the name suggests these are not relations. The upper and lower classes do implement a proper relation. Well, I'm not entirely sure about all dark corners of Unicode character properties.

I agree that these classes are rather confusing and it was probably a bad idea to support this translation using char_type/2.

UWN commented 11 months ago

UWN_open