From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel 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 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1375931877 18321 80.91.229.3 (8 Aug 2013 03:17:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 8 Aug 2013 03:17:57 +0000 (UTC) Cc: Emacs developers To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 08 05:18:01 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V7Gjg-0006K5-JM for ged-emacs-devel@m.gmane.org; Thu, 08 Aug 2013 05:18:00 +0200 Original-Received: from localhost ([::1]:40236 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7Gjf-0002A1-Nc for ged-emacs-devel@m.gmane.org; Wed, 07 Aug 2013 23:17:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7Gjb-00029n-GL for emacs-devel@gnu.org; Wed, 07 Aug 2013 23:17:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V7Gja-0005IR-5b for emacs-devel@gnu.org; Wed, 07 Aug 2013 23:17:55 -0400 Original-Received: from mail-ve0-x236.google.com ([2607:f8b0:400c:c01::236]:42186) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7Gja-0005IH-1s for emacs-devel@gnu.org; Wed, 07 Aug 2013 23:17:54 -0400 Original-Received: by mail-ve0-f182.google.com with SMTP id m1so2601799ves.41 for ; Wed, 07 Aug 2013 20:17:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=U5NXuQuqxQZuY1fqBRWalgE+aDtPF12Ft9Usb0o++VM=; b=xPGZnzQZ9Tj9pXJG+Wa3BOwSADoiWJ5HdFwjLgwiOwwCTu2ziyA0w3IZBbpUQNe9sD m3lg9YYwDx5/o3ueDmvGUBWnrGqlRIQlPFsHYNKJ6/uVeWMHZbz9zXgTsBp3cLig0rit nK6HmSYsVnz6HJtkJAbFWYphKtA9y48f/FGxtqUEc3i+baR/9R8d/QrTWWM+zd8Y8yG/ UJED7MKr7mCG4PWXiGrwncAkEcDo1q0tJ6+CNVJ5TX+gW8xEvYA5wvXCG5oTjLL9kQi4 zmVrTVftZbTSwCmhSR6SgHAp47M9t+u+Q4nv7sfw8mEBFvUBkyyVvXOr9dBuTPB/rw2l a+1Q== X-Received: by 10.220.48.194 with SMTP id s2mr198324vcf.43.1375931873614; Wed, 07 Aug 2013 20:17:53 -0700 (PDT) Original-Received: by 10.220.245.8 with HTTP; Wed, 7 Aug 2013 20:17:13 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400c:c01::236 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:162481 Archived-At: On Thu, Aug 8, 2013 at 4:46 AM, Stefan Monnier 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 . [...] * (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