guile-devel
[Top][All Lists]
Advanced

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

Re: Trouble with `export'.


From: Rob Browning
Subject: Re: Trouble with `export'.
Date: 04 Jun 2001 12:04:08 -0500
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Marius Vollmer <address@hidden> writes:

> Hmm, not really, I'd say.  What `define' could do is to check whether
> the right variable is in the public interface and correct it if its
> the wrong one.  This feels unclean to me.
> 
> > In this situation, aren't you defining a binding that as far as the
> > local module is concerned, already exists?
> 
> Yes, but it exists accidentally.  Moreover, I think the redefining of
> existing bindings is ok...

Hmm.  It doesn't seem accidental to me.  You have to explicitly "use"
another module which implies that you need to be aware of the symbols
it exports.  I guess it depends on interpretation, and I've probably
not thought about this enough to understand all the ramifications, but
I've tended to think of a (use-modules (bar)) as, in part, being
effectively equivalent to (define foo ...) for every exported symbol
in module bar.

Under that interpretation, a subsequent (define foo ...) in the module
would be an error.  To avoid the error, the module needs to either use
a different symbol internally, or use whatever functionality exists to
rename the imported symbol at import time.

> The behavior of `export' and `re-export' will be this:

I can't think of any real problems with this proposal, but even here,
I still tend to think that if you say:

  (use-modules (ice-9 script))
  (define use-emacs-interface #t)

You should get an error.  It ought to be:

  (use-modules (ice-9 script))
  (set! use-emacs-interface #t)

But as I said, I quite sure I may be missing something important here.

-- 
Rob Browning <address@hidden> PGP=E80E0D04F521A094 532B97F5D64E3930



reply via email to

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