Thanks for the clarification. Then my earlier comment (8973117) still applies regarding that some functions should not be removed from the top level (sleep, abs, acos, ceil, exec), and that it should be clear that functions like POSIX.sleep and POSIX.abs are only aliases that doesn't actually use the libc implementations.
I can point out that I also never touched the issue of where the function implementations should be. As you say, it really doesn't matter.
/ Martin Stjernholm, Roxen IS
Previous text:
2002-09-04 18:03: Subject: argv[0]?
ok, here's a recap:
- All posix functions should be _moved_ to the POSIX module. That means:
- they will not be available at their old, compatible location
- old code which expects them at the old location will stop working
- The functions moved in #1 can be aliased, in the compatibility mode, at
their old locations thus removing the compatibility problem above.
- The functions moved (as in the code sense and the namespace sense) to
the POSIX module might be aliased from other spots in the namespace (like Math, for example) to make their location more logical from the usage standpoint. It can be done in the other directions - the functions code gets moved to, say, Math and it is aliased in the POSIX module.
The effect is that the functions are "physically" available in one module, the one named after the standard the functions are defined in (POSIX, WIN32, WIN64, BSD, whatever other standards we might find useful) and they are "virtually" available from other locations, which make more sense from the logical point of view. Now let's imagine a user migrating from C/C++ to Pike. They are used to use the manpages, they look at the chmod(2) manpage, and they read at the bottom:
CONFORMING TO The chmod call conforms to SVr4, SVID, POSIX, X/OPEN, 4.4BSD. SVr4 documents EINTR, ENOLINK and EMULTIHOP returns, but no ENOMEM. POSIX.1 does not document EFAULT, ENOMEM, ELOOP or EIO error conditions, or the macros S_IREAD, S_IWRITE and S_IEXEC.
They also read in the Pike docs that functions defined by the POSIX standard can be found in the POSIX module, so they know right away that they should use:
POSIX.chmod(...)
in their code.
Another scenario is where a programmer wants to use a math function. If the function is POSIX, they can use the above approach, but they can also read in the docs that the mathematical routines are found in the Math module, so they can use
Math.ceil(...)
Now, _where_ the functions are defined (in the source code sense) doesn't really matter from the programmer's POV, what matters is where they appear to them. Thus the proposition of the function aliases.
/ Marek Habersack (Grendel)