On Jan 26, 2015, at 11:55 AM, Ricardo Signes wrote:

Perl programmers have to account for the types of strings across module
and call boundaries without any help from the language.
I agree it would be nice to improve this. But I fear there is no sane
way to do it.
I would not be too surprised if that is the final conclusion, either.
Well, Perl is a work in progress, so I don’t see why anything has to be concluded finally here. What if we took an incremental approach?

* First, add a flag.
* Second, add a way to check that flag.
* Third, add string::to_chars() and string::to_bytes() to convert to and from (would include validation).

This would be a good first pass, in my mind, and keeps things pretty limited. But it at least provides some visibility, and a way for Perl developers to finally be able to recognize Unicode strings.

Later phases could, if appropriate:

* Add I/O layers
* Add support to Encode.pm.
* Add pragmas to auto-convert within a lexical scope
* Start adding warnings for the most egregious mis-uses (concatenation).

In my mind, this is a real pain point for Perl developers, one that deserves a pragmatic approach to solving it, starting with the simplest thing that could help and working forward to improve it over time. No need to do everything at once.

Is this do-able?



Search Discussions

Discussion Posts


Follow ups

Related Discussions



site design / logo © 2019 Grokbase