guile-devel
[Top][All Lists]
Advanced

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

Re: obsolete (?) stuff in boot-9


From: Marius Vollmer
Subject: Re: obsolete (?) stuff in boot-9
Date: 12 May 2001 15:14:30 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.102

> Dirk Herrmann <address@hidden> writes:
>
> > Hello everybody.
> > 
> > I have found a couple of definitions in boot-9.scm, which could probably
> > be removed (after deprecating them for a while).  I am not saying that the
> > definitions are not useful in principle, but I doubt they should be
> > included in boot-9.
> > 
> > The definitions that could probably be removed include:

It is hard to decide what can be removed by looking only at what Guile
itself uses because boot-9.scm has no clear distinction between
internal and exported definitions.  Thus, I'd say we should first move
most of bot-9.scm into a proper module, and in that process we can
decide what to export and what not.

For every obscure feature that is exported we should find a good
reason and document it.  One reason might be that the feature is for
comptability with other Scheme implementations, or with the mindset of
Common Lisp, but now that we have the SRFIs, we should concentrate on
them first for portability.

> > * pk as an alias for peek.  One of them should be enough, IMO.

I don't think it is problematic to have these two aliases and it is
not clear to me which one is better so we should just keep them both.

> > * -1+ as an alias for 1-.  I think everybody would use 1- anyway.

Yes, I would think so.  `-1+' can be deprecated.

> > * return-it as an alias for noop.  Does anybody use this at all?

It has no obvious good use so we should not lead people to think it
has.  Deprecated.

> > * and=>.  Not used, and the name is not obvious, so who would use it?

I find this quite useful and the name even makes sense to me.  It is
analogous to the `=>' syntax of `cond'.  One idiom where `and=>' is
useful is to access alists:

    (and=> (assoc 'foo alist) cdr)

It's like a one-variable `and-let*' without having to invent a name
for that variable.

    (and-let* ((cell (assoc 'foo alist)))
      (cdr cell))

> > * string-character-length is just an alias for string-length.

Does this have anything to do with multi-byte character sets?  In any
case, deprecated.

> > * flags is obsolete since logior also handles 0 and 1 arguments.  Further,
> >   the name is unfortunate, since identifiers named flags are used all over
> >   guile.

Yep.

> > Further, some of the bindings of the module system appear not to be used.
> > If we are going to replace the module system it could be helpful to first
> > get rid of stuff that is not used anyway, thereby reducing the complexity
> > when it comes to switching to the new system.

I think there will come a natural point where to remove this stuff.
Now that we use variables consistently (in the branch) and the concept
of `bindings of symbols' does no longer exist, the `module-symbol-*'
stuff should be removed as well (on the branch).  But

> >   set-module-obarray!
> >   set-module-binder!
> >   module-clear!

should remain.

> > The whole module observer stuff seems to be unused:  There is no place in
> > guile where observers are added.  Thus, the following functions could
> > potentially be removed:

Hmm, observers will be the mechanism to hook the evaluator into the
module system so that it can keep up with changing mappings from
symbols to variables.

I will seriously look at replacing the innards of our current modules
with the `environment' objects, and they offer a observer mechanism as
well, so we might not use the module stuff as implemented now, but the
concept is still valid.  It is just not used yet.

> > The functions make-root-module and make-scm-module could IMO be inlined
> > into the definitions of the-root-module and the-scm-module.  I don't think
> > they are of any further use.

They do no longer exist (in the branch).



reply via email to

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