Naming conventions for functions in similar modules
Jacob Carlborg
doob at me.com
Wed Jun 22 06:12:52 PDT 2011
On 2011-06-22 13:47, Lars T. Kyllingstad wrote:
> On Tue, 21 Jun 2011 23:30:49 -0700, Walter Bright wrote:
>
>> On 6/21/2011 10:38 PM, Jonathan M Davis wrote:
>>> For example, should we have
>>>>> std.ascii.toLower and std.uni.toLower or std.ascii.toAsciiLower and
>>>>> std.uni.toUniLower?
>>
>>
>> I think we've failed if we have to name things std.ascii.toAsciiLower,
>> i.e. having to repeat the module name in the function name in order to
>> disambiguate it.
>
> One problem: std.uni only contains functions for dealing with upper/
> lower case and for checking whether something is an alpha character. If
> you want the other functions, such as isDigit(), isPunctuation(), etc.
> you still have to import std.ascii. And once you have imported both
> std.uni and std.ascii, you are forced to disambiguate every time you call
> a function which exists in both.
>
> Would it make sense to move or add isDigit and so on to std.uni? Would
> Unicode-aware versions of these functions be different from the ASCII
> versions?
>
> -Lars
There is isNumeric in std.string, although I don't know if they behave
the same.
--
/Jacob Carlborg
More information about the Digitalmars-d
mailing list