develooper Front page | perl.perl5.porters | Postings from April 2014

Is a string with an embedded NUL called a 'buffer' ?

Thread Next
From:
Karl Williamson
Date:
April 23, 2014 01:52
Subject:
Is a string with an embedded NUL called a 'buffer' ?
Message ID:
53571D11.60408@khwilliamson.com
There are some functions in Perl that take a byte sequence and a length 
as input, and whose API descriptions refer that sequence as a string, 
not mentioning that it is legal for the string to contain NULs.

There is a patch, which I can no longer find, that proposes to call 
these parameters 'buffers'.

It is true that some of the functions we have that operate on this data 
structure have names that end with '_buf', which appears to be because 
of the ability to contain embedded NULS, but my brain rebels at calling 
such a 'string' a 'buffer', as it is not the meaning of the word 
'buffer' that I was taught.

To me, the term "C string" means a string without NULs, and one that has 
them is just "string"

Am I wrong about Perl conventional usage?

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About