From: Mario M. <mo...@ig...> - 2003-12-04 09:03:22
|
Nikodemus Siivola <nik...@ra...> writes: > So, I submit that > > (1) No non-masochist would use the buffer-argument to readlink > given the possibility to drop it and have the system > do "the right thing". > > (2) The interface for such cases is non-obvious, so documentation > beyond the man-pages is really needed. For some functions > it can just punt and refer to the man-page, thankfully. > > (3) Readlink isn't a unique case. POSIX readdir is another example > with a convoluted interface, albeit in a different way. > > Hence, I'm wondering if it might not make more sense after all to > follow the POSIX-interfaces only when they are reasonably sane, and do > something less painfull in other cases -- and document this for every > function. > > I'm willing to claim that for the overwhelming majority of cases the > sane interface is rather obvious. There will be cases where it isn't, > but that happens with the current policy as well (at least if you > count readlink as such a case. How about having two functions? One that is just the raw ffi interface, and one that is the sane version? Just put them in different packages - problem gone. It might be a good idea anyway, since users might disagree with your wrapping policy for whatever reason. Another posibility is to use POSIX:|readdir| for the original one, and POSIX:READDIR for the nice one. |