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 05:17:13 +0200 [thread overview]
Message-ID: <CAAeL0SRgh3Eo4PznNhMpyq73PTXSy+OuDscQV8-3TA95SNgHiQ@mail.gmail.com> (raw)
In-Reply-To: <jwvli4crjhs.fsf-monnier+emacs@gnu.org>
On Thu, Aug 8, 2013 at 4:46 AM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> I don't really care that it doesn't always return t as non-nil value.
OK.
> But its non-nil value should be treated by its docstring (and by
> callers) as a boolean equivalent to t. Otherwise it's not just
> a "predicate" but an accessor.
Not in CL parlance: a predicate is "a function that returns a
generalized boolean as its first value." No other restrictions. It's
the callers' responsibility to treat its result as a boolean.
Yes, I'm aware this is elisp and not CL. Unfortunately.
> You can use the built-in frameset-p (and then remove the :named
> and :type as well, so that the tag becomes internal/hidden, which
> I also find cleaner)).
Both are hidden, as it is something that you don't ever see (except,
in this case, in the frameset-p predicate). But, if you ever happen to
see the tag, cl-struct-frameset is horrible. "cl-defstruct-" is jus
the implementation leaking.
C:\> sbcl
This is SBCL 1.1.4.0.mswin.1288-90ab477, an implementation of ANSI
Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.
[...]
* (defstruct frameset a b c)
frameset
* (make-frameset)
#S(frameset :a nil :b nil :c nil)
which is much nicer (even after #S).
But the deeper question is, I really prefer to have a more checking
frameset-p. I want to discourage people of going the make-frameset
route and using frameset-save instead.
J
> That's it's more idiomatic?
A predicate is something that checks inclusion in a type.
[cl-struct-frameset "Hello" "Goodbye" 'nothing 'to 'see 'here [0 0 0]]
is not a frameset, even if the built-in frameset-p thinks so.
J
next prev parent reply other threads:[~2013-08-08 3:17 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 [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAAeL0SRgh3Eo4PznNhMpyq73PTXSy+OuDscQV8-3TA95SNgHiQ@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.