El 11/05/2016 a las 16:38, Michael Van Canneyt escribió: > >> FPC 3.0 adds unsafe auto-conversions > > Why do you think it is unsafe ? > I have an answer for this.
In short: Different codepage strings and raw strings should be considered different incompatible types. Pascal is a hardtyped language, and I love that, and codepages are prone to errors (all these threads prove it). Something about codpages needs a second thought. a) There shouldn't be automatic conversion at all. b) The codepage of a string shouldn't change when you assign a string with another codepage, just rise an error. c) Corollary of previous premises: Empty strings should also have codepage. Extra 1) Beside calling SetSetcodepage, it would be handy that you could set the codepage when you declare a string. I don't mean codepage should be statically typed, just it would be handy. Extra 2) Being able to set the codepage statically, so that mismatch codepage could be detected in compiler time, would be handy. In this case I do mean codepage could also be statically typed, -- Saludos Santi s...@ciberpiula.net
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal