unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Juanma Barranquero <lekktu@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] trunk r113747: lisp/frameset.el: Convert `frameset' to vector and add new slots.
Date: Wed, 07 Aug 2013 21:56:06 -0400	[thread overview]
Message-ID: <jwvwqnxymmv.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <E1V7CcV-0008Ec-F2@vcs.savannah.gnu.org> (Juanma Barranquero's message of "Wed, 07 Aug 2013 22:54:19 +0000")

> +(defun frameset-p (object)
> +  "If OBJECT is a frameset, return its version number.

I know we have some offenders, but please try to stick to "foo-p returns
a boolean".

>  Else return nil."
> -  (and (eq (car-safe frameset) 'frameset) ; is a list
> -       (integerp (nth 1 frameset)) ; version is an int
> -       (nth 3 frameset)            ; states is non-null
> -       (nth 1 frameset)))          ; return version
> +  (and (vectorp object)                   ; a vector
> +       (eq (aref object 0) 'frameset)     ; tagged as `frameset'
> +       (integerp (aref object 1))         ; version is an int
> +       (consp (aref object 2))            ; timestamp is a non-null list
> +       (stringp (or (aref object 4) ""))  ; name is a string or null
> +       (stringp (or (aref object 5) ""))  ; description is a string or null
> +       (listp (aref object 6))            ; properties is a list
> +       (consp (aref object 7))            ; and states is non-null
> +       (aref object 1)))                  ; return version

Also, this doesn't just test whether it's a frameset or not (which is
what one expects from "frameset-p") but it does some sanity checks
as well, something I'd call maybe "frameset-valid-p".


        Stefan



       reply	other threads:[~2013-08-08  1:56 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 ` Stefan Monnier [this message]
2013-08-08  2:12   ` [Emacs-diffs] trunk r113747: lisp/frameset.el: Convert `frameset' to vector and add new slots 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
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwvwqnxymmv.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=lekktu@gmail.com \
    /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 public inbox

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

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).