[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Module name mangling

From: Neil Jerram
Subject: Re: Module name mangling
Date: 31 Jan 2001 20:34:14 +0000

>>>>> "Martin" == Martin Grabmueller <address@hidden> writes:

    >> 3. For DOS: use _ as the escape character, encode `*' as
    >> `_star_' and `_' as `_underscore_'.

    Martin> That would work with vfat, but not with the old fat (8+3
    Martin> rule).  But I don't think that's a serious problem, since
    Martin> Guile does not run under plain DOS anyway.


    >> The only remaining problem is that of CVS and distributions.
    >> Let's assume that we don't want the DOS source distribution to
    >> differ from the non-DOS one, and that we want to support CVS
    >> direct to/from DOS.  Solution: invent a shar-like format --
    >> grokked by Guile, of course -- in which to hold .scm files with
    >> unsafe names, and unpack it at build/install time.  `Files with
    >> unsafe names' is defined as { file : filename encoded by any of
    >> the supported encoders != canonical filename }.

    Martin> Hmm. Maybe I have overlooked something, but with this
    Martin> approach bootstrapping Guile on an inferior system will be
    Martin> a problem. How to unpack Guile if you need Guile to do it?

I'm assuming that (i) this whole thing only applies to .scm files (ii)
people won't use unsafe names for files (e.g. boot-9.scm) needed to
bootstrap Guile itself.

    >> In practice, this encapsulation may encourage developers to go
    >> for `safe' names, but (i) it doesn't require it, and (ii) it
    >> provides a compatible solution when a name previously believed
    >> to be safe (for all supported platforms) becomes unsafe.

    Martin> Your proposal addresses one half of the problem: the
    Martin> filesystem.  But how does boot-9.scm know which encoding
    Martin> it should use when searching for modules?

This could be triggered at configure time, by installing the correct
encoder for the host, or at runtime, using (uname) or something
similar.  Configure time seems theoretically cleaner to me.

    Martin> One possibility is to use the normal module name for
    Martin> constructing the file name, and if that fails (as in DOS
    Martin> for and-let*.scm), fall back to an encoding like that
    Martin> proposed by Neil (see above).

Yes, so long as we can reliably tell whether it `failed' or not.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]