guile-user
[Top][All Lists]
Advanced

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

Re: use-modules: selecting, which symbols not to load


From: Panicz Maciej Godek
Subject: Re: use-modules: selecting, which symbols not to load
Date: Fri, 28 Dec 2012 01:05:47 +0100

2012/12/27 Thien-Thi Nguyen <address@hidden>:
> () Panicz Maciej Godek <address@hidden>
> () Thu, 27 Dec 2012 04:43:16 +0100
>
>    I think it can sometimes be desirable to import the whole public
>    interface except certain bindings.
>
> Could you give a non-contrived example?  I can't think of any, myself.
> I remember toying w/ the idea when adding ‘#:renamer’, w/ same doubts.

I recently had two similar cases, related with similar problem --
namely, with goops' generics. I wanted to use some features (I guess
those were bytevector features) from (rnrs) module, but I also
imported `write` and `display` procedures, which overrode the `write`
and `display` generics from goops. I knew that I wasn't using write
nor display from (rnrs) (because I didn't even realize their
existence), but I didn't remember which features exactly did I use.
Yesterday I had a similar case, because I was trying to make generics
from slot-ref and slot-set! so that I could be able to extend their
functionality, because I'm trying to extend the goops system to better
suit my needs -- so I'd wish, for instance, to be able to record
easily, which slots of an object have been modified -- and while I was
trying to manage it using macros (and introducing a `define*-class`
form with extended syntax), it occurred to me that using generics
would be much simpler.

>    [...] and require me to change my header as the module changes.
>
> Note that maintaining a blacklist and maintaining a whitelist is still
> maintenance.  Better to ‘#:select’ exactly what you need and no more,
> i.e., take a purely constructive stance.  That's maintenance, too, but
> the eye work is locally concentrated, which builds Quality, rather than
> broadly dispersed, which destroys (or, at best, delays) trust.  (IMHO.)

I have to say that I completely don't understand this point. I'd never
think, that 'precision' is the word that would apply to a module
system. For me, the module system should be convenient, rather than
'concentrated'. It's like if -- in a conversation -- you'd need to
specify which words you are going to use in which meaning beforehand,
before you even say anything meaningful.
Such symbols, as +, -, /, *, are available in scheme, even if you're
not using any arithmetics in your program. Is it this 'broad
dispersion' that you mentioned? I always get frustrated that I have to
(use-modules (ice-9 match) (srfi srfi-2)), because I use the 'match'
and 'and-let*' syntaxes as a part of the common logic of the language.
OK, maybe arithmetics is an exception. But it's really a surprise that
such procedures as inet-aton or select are available in the core
guile, because I'd rather expect to (use-modules (unix socket)) or
something like that, before using them.
But I'm used to thinking of modules as if they were (more or less
consistent) domains, so I would find it extremely irritating if I had
to say explicitly, which notions from that domain I want to use.

Thanks for your reply :)



reply via email to

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