[M3devel] exposing both path name types?

Jay jayk123 at hotmail.com
Sun Feb 24 01:22:29 CET 2008


What is the idiom for this:
 
Currently:
There is Pathname.i3.
PathnamePosix EXPORTS Pathname
PathnameWin32 EXPORTS Pathname
You can only have one in a link.
 
It would seem possibly useful to have:
Pathname.i3 unchanged
PathnamePosix.i3 identical to Pathname.i3 (some what to avoid the duplication?)
PathnameWin32.i3 identical to Pathname.i3 (ditto)
 
On Posix targets:
  PathnameWin32.m3 exports just PathnameWin32
  PathnamePosix exports both PathnamePosix and Pathname
 
On Windows targets:
  PathnamePosix exports just PathnamePosix
  PathnameWin32 exports both PathnameWin32 and Pathname
 
That is Pathname.Foo resolves statically at compile time to the target-specific library.
PathnameWin32.Foo and PathnamePosix.Foo are also both explicitly available.
 
These modules each import nothing, except Text. They do all their string manipulation themselves.
 
Olaf's recent Quake extensions document but don't implement
    pn_native( pn ) --> text    pn_posix( pn ) --> text    pn_win( pn ) --> text
As long as pn is a fullpath, these are easy, I just wrote up prototypes, haven't compiled them.
 
I think these functions might suggest doing what I'm asking about as well, maybe.
Or maybe you'd just convert and then never pick back apart.
 
I have sleazed by for now by using subst_text / to \ and setting up NTFS junctions.
In this way, I can cross build NT386 <=> NT386GNU either host, either target.
Had I not done anything, the linker interprets /cygdrive/c/foo/bar.lib as a command switch and says it doesn't understand it.
Not a big deal, but I think there might be some easy progress here.
 
This is not just about Pathname.
 
It is also about File.
Even though NT386GNU File is FilePosix, it would be useful to allow the serial package to use FileWin32 instead.
But FilePosix and FileWin32 both reveal the same types.
It'd be nice if they could expose FilePosix.T and FileWin32.T and then only one of them reveal File.T = FilePosix.T or File.T = FileWin32.T, something like that.
 
 
 - Jay
_________________________________________________________________
Climb to the top of the charts! Play the word scramble challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20080224/69834e24/attachment-0002.html>


More information about the M3devel mailing list