Re: Standard library direction
- Posted by DerekParnell (admin) Sep 23, 2008
- 906 views
A recent thread by Don Cole lead to the suggestion that a win32 (disk stats) only function was added to the standard library.
Might I respectfully suggest that a function that is platform specific is not added to the standard library, as then the library will no longer be standard.
Firstly, those functions have not been added to the library. Only permission was sought.
The term 'standard library' means the library that is officially supported - nothing more. If such a library contains platform specific functionality it is still a standard library.
In fact, the standard library already contains platform specific functions. Consider the DOS only graphics routines, and the get_curdir function, used to get the current directory for specific Windows/DOS drives. There is also the driveid() function that returns the drive ID from a supplied path. And not to forget, message_box() which is a Windows only routine.
And realize that if the Windows version of the disk stats functions were added, it does not mean that a Unix version can never be added, because all it needs is someone to write it. There is no requirement that the same person writes ALL the variations of a function for different platforms.
There could be an option to add win32 functions to a sub directory include/std/w32 (and by inference an include/std/lnx subdirectory).
This maybe useful for stuff that can only be platform specific. We already have a std/dos directory. Maybe the message_box() function should be moved to std/win?
I believe I remember seeing, back at the inception of the standard library project, that one of the constraints was that all functions and procedures contained therein should be cross platform.
This is plainly not possible nor is it actually a real requirement. It would be a good thing that, wherever possible, cross platform versions of routines existed, but there will always be some routines that can only be platform specific - and still be officially supported.