On Tue, Sep 12, 2000 at 03:26:01PM -0500, Jarkko Hietaniemi wrote:
> On Tue, Sep 12, 2000 at 03:24:36PM -0400, [EMAIL PROTECTED] wrote:
> > On Tue, Sep 12, 2000 at 01:56:52PM -0500, Jarkko Hietaniemi wrote:
> > > 
> > > =head2 Toggling UTF-8-ness
> > > 
> > >   on_utf8(STRING)
> > > 
> > > [INTERNAL] Turn on the UTF-8 flag in STRING.  The data in
> > > STRING is B<not> checked for being well-formed UTF-8.  Do not
> > > use unless you B<know> that the STRING is well-formed UTF-8. 
> > > Returns nothing.
> > 
> > Returning nothing is a waste. Would it be useful to return the previous
> > value of the UTF-8 flag? Same for off_utf8.
> 
> I actually thought exactly the same thing but that leasds into funny
> semantics where a false return values signifies a success, and vice versa.


Why is that a problem? The function doesn't return success or failure.
It returns the previous state. One could return 'undef' or '-1' if one
wishes to make a special case for failure. (Already in Perl, index()
returns -1 on failure, and fork() returns undef on failure, while in
both cases, a (false) return value of 0 indicates success).



Abigail

Reply via email to