unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* when to #:replace
@ 2010-06-20 20:57 Andy Wingo
  2010-06-20 21:29 ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Wingo @ 2010-06-20 20:57 UTC (permalink / raw)
  To: guile-user

Hello,

As you probably know, Guile is fairly flexible when dealing with
duplicate bindings -- one can warn, error, choose the last one, first
one, etc.

But currently there are lots of warnings, way too many. For example just
using srfi-69 gives you a warning:

  WARNING: (guile-user): imported module (srfi srfi-69) overrides core binding `make-hash-table'

So I think there is confusion among both users and developers of Guile.
I thought a little about the problem and here's a kind of FAQ regarding
duplicate bindings:

  Q: I have a module that overrides a core binding (like
  make-hash-table). Should I #:export that binding or #:replace it?

  A: #:replace. Presumably the user knows what she is doing when she
  uses your module. If she really cares she can change the duplicate
  bindings resolution mechanism to disallow such imports.


  Q: How do I suppress duplicate bindings warnings?

  A: Fix your module so that you rename one of the bindings on import.


  Q: How do I suppress a "overrides core binding" warning when importing
  a module?

  A: Fix that module so that it uses #:replace for that binding instead
  of #:export.


Now, off to fix R6RS modules in this regard...

Andy
-- 
http://wingolog.org/



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-07-17 11:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-20 20:57 when to #:replace Andy Wingo
2010-06-20 21:29 ` Ludovic Courtès
2010-06-21 19:33   ` Andy Wingo
2010-06-21 21:54     ` Ludovic Courtès
2010-06-21 22:09       ` Andy Wingo
2010-07-17 11:31       ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).