all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Emacs developers <emacs-devel@gnu.org>
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	[thread overview]
Message-ID: <CAAeL0STy0FThkvhATp1kCxWhfHCNbYhHt9wKZ-WZ2e11UwCuxQ@mail.gmail.com> (raw)
In-Reply-To: <jwvy58cq1ba.fsf-monnier+emacs@gnu.org>

On Thu, Aug 8, 2013 at 6:09 AM, Stefan Monnier <monnier@iro.umontreal.ca> 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	other threads:[~2013-08-08 10:04 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1V7CcV-0008Ec-F2@vcs.savannah.gnu.org>
2013-08-08  1:56 ` [Emacs-diffs] trunk r113747: lisp/frameset.el: Convert `frameset' to vector and add new slots Stefan Monnier
2013-08-08  2:12   ` Juanma Barranquero
2013-08-08  2:46     ` Stefan Monnier
2013-08-08  3:17       ` Juanma Barranquero
2013-08-08  4:06         ` Drew Adams
2013-08-08  4:09         ` Stefan Monnier
2013-08-08 10:04           ` Juanma Barranquero [this message]
2013-08-08 13:03             ` Juanma Barranquero
2013-08-08 13:18             ` Stefan Monnier
2013-08-08 13:43               ` Juanma Barranquero
2013-08-08 14:40                 ` Stefan Monnier
2013-08-08 15:34                   ` Juanma Barranquero
2013-08-08 16:32                     ` Stefan Monnier
2013-08-08 17:00                       ` Juanma Barranquero
2013-08-08 17:28                         ` Stefan Monnier
2013-08-08 16:50                     ` Drew Adams
2013-08-08 16:51                       ` Juanma Barranquero
2013-08-08 17:18                         ` Drew Adams
2013-08-08 17:32                           ` Stefan Monnier
2013-08-08 17:47                           ` Juanma Barranquero
2013-08-08 17:51                             ` Juanma Barranquero
2013-08-08 16:32                   ` Juanma Barranquero
2013-08-08 17:30                     ` Stefan Monnier
2013-08-08 17:34                       ` Juanma Barranquero
2013-08-08 18:22                         ` Stefan Monnier
2013-08-09  0:38                           ` Juanma Barranquero
2013-08-08 16:37               ` Drew Adams
2013-08-08  4:05       ` Drew Adams
2013-08-08 15:42     ` Richard Stallman
2013-08-08 15:49       ` Juanma Barranquero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAeL0STy0FThkvhATp1kCxWhfHCNbYhHt9wKZ-WZ2e11UwCuxQ@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.