Le Mon, 26 Feb 2018, peter frey wrote: > Simon occasionally includes code from some other part of the libraries to > avoid requiring, say, Gen to access Sequence or Containers; I don't remember > offhand. In the case of some tiny piece of code thats sensible. (And so far > that is all I have provided)
Indeed, and I find it sensible too to have a basic UTF8 encoder/decoder. > Pervasives has now a type uchar which Uutf uses consistently. In the case > that one is not dealing with the many exigencies that Uutf deals with, thats > a bit overkill? Alain Frisch used ints in Ulex and I remember another usage > of uchar only in Camomille. > > Uutf has a smaller range of codes that it accepts; namely Utf8. > Thats 0 to (1024 * 16) + (1024 * 16) + (64 * 1024) where 64k portion at the > end is also excluded from the 1Mb range before. > > Originally Utf8 encoded all possible codes in the positive int32 range. > I prefer to revert to the old standard; (and call it Utf31) since I this > allows me to encode alphabets that are larger than, but include, the utf8 > range. (This may not work with js_of_ocaml; but not all applications > involve the web) I'm not sure I understand, what is the point of supporting "more" than utf8? > When it comes to comparing utf8 chars (codes; ints) consider the following: > > utop # ((=));; > - : 'a -> 'a -> bool = <fun> after loading utop > utop # open Containers;; > utop # ((=));; > - : int -> int -> bool = <fun> type is overloaded > utop # > > ( I noticed this also in Jane Streets's "Sequence" . Possibly they want to > avoid 'polymorphic' comparisons; i.e.: comparisons that examine the > internal structure) > > Did you intend to do that? It's intended, yes. You can find a rationale for it in the CHANGELOG file or on release notes for 2.0. -- Simon Cruanes http://weusepgp.info/ key 49AA62B6, fingerprint 949F EB87 8F06 59C6 D7D3 7D8D 4AC0 1D08 49AA 62B6
signature.asc
Description: PGP signature
_______________________________________________ Containers-users mailing list [email protected] http://lists.ocaml.org/listinfo/containers-users
