[Top][All Lists]

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

Re: Module name mangling

From: Martin Grabmueller
Subject: Re: Module name mangling
Date: Wed, 31 Jan 2001 05:47:56 +0100

> From: Neil Jerram <address@hidden>
> Date: 30 Jan 2001 22:23:59 +0000
> Here's my proposal, which doesn't require a comprehensive list of
> unsafe or safe characters.
> 1. Address the problem in an OS-specific way.  => no encoding at all
>    needed for Unices, no need to change and-let*.scm for the people for
>    whom it already works.

This rule I like ;)

> 2. For each OS, only address the known problems.  For DOS, we only need
>    to solve the problem right now for `*', so let's only do that.
>    Point (1) above means that the need-to-fix approach of point (2)
>    will never invalidate a filename that used to work on a different
>    platform.
> 3. For DOS: use _ as the escape character, encode `*' as `_star_' and
>    `_' as `_underscore_'.

That would work with vfat, but not with the old fat (8+3 rule).  But I
don't think that's a serious problem, since 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 }.

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

> 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.

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

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

Martin Grabmueller              address@hidden  address@hidden on EFnet

reply via email to

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