emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] trunk r113747: lisp/frameset.el: Convert `frameset' to


From: Juanma Barranquero
Subject: Re: [Emacs-diffs] trunk r113747: lisp/frameset.el: Convert `frameset' to vector and add new slots.
Date: Thu, 8 Aug 2013 12:04:04 +0200

On Thu, Aug 8, 2013 at 6:09 AM, Stefan Monnier <address@hidden> wrote:

> So we agree: the return value should be treated as a boolean, even if it
> may not always be restricted to t or nil.  So it shouldn't document its
> return value as being something else.

Fixed; now references to `frameset-p', and its docstring, only mention
nil and non-nil values.

> Actually, if we ever want to save those vectors to a file, then I agree
> that `frameset' is indeed better than `cl-defstruct-frameset'.

We save those vectors to a file, in desktop.el. That's the whole point
of creating framesets.

> Then why don't you remove make-frameset and replace it with a good
> constructor which can only build elements that agree with your tighter
> constraints?  You wouldn't need to check those constraints in frameset-p
> any more since they'd be true by construction.

I sort of did. make-frameset is specifically not documented, and the
docstring for the type has this bit:

 - `frameset-save', the type's constructor, captures all or a subset of the
   live frames, and returns a serializable snapshot of them (a frameset).

The reason I didn't completely remove make-frameset is because I use
internally. It's a tiny bit cleaner that constructing the vector by
hand.

> Indeed.  Not something that returns a version number.

A generalized boolean :-)

> It's a frameset, it's just not a valid one.

I am not sure I agree that a bottle of water is a bottle of Vega
Sicilia, just an invalid one...

> If/when cl-defstruct is
> extended to support type annotations on its slots, then I might agree with
> you, but note that if this ever happens, the type checks will not be in
> frameset-p but in the constructors and the setters.

OK, it's your show, your rules. :-)

I've allowed again the built-in frameset-p, and renamed (and expanded)
the old one as frameset-valid-p. frameset-restore still uses the more
thorough one.

Also, I've added docstrings for frameset-p and all slot accessors, via
(put 'frameset-SLOT 'function-documentation "Docstring."). Oh the joy.
Please tell me that I just missed a way to define the docstrings in
the cl-defstruct declaration...

    J



reply via email to

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