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 12:04:04 +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 1375956295 27269 80.91.229.3 (8 Aug 2013 10:04:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 8 Aug 2013 10:04:55 +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 12:04:54 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 1V7N5O-0004e1-TX for ged-emacs-devel@m.gmane.org; Thu, 08 Aug 2013 12:04:51 +0200 Original-Received: from localhost ([::1]:53307 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7N5O-0001cz-8u for ged-emacs-devel@m.gmane.org; Thu, 08 Aug 2013 06:04:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7N5K-0001cu-Ug for emacs-devel@gnu.org; Thu, 08 Aug 2013 06:04:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V7N5J-0001vA-Ki for emacs-devel@gnu.org; Thu, 08 Aug 2013 06:04:46 -0400 Original-Received: from mail-ee0-x233.google.com ([2a00:1450:4013:c00::233]:54012) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7N5J-0001uu-Cu for emacs-devel@gnu.org; Thu, 08 Aug 2013 06:04:45 -0400 Original-Received: by mail-ee0-f51.google.com with SMTP id c1so1403113eek.24 for ; Thu, 08 Aug 2013 03:04:44 -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=qIF75N948EE+mwaBeLqkS/wTWtWl59yNbi++wjKEB3Q=; b=Ptg4zNEJ5+FgWZHr/hNfhYdNmyNfiVtDVn3YBulmyPaUVx3k8YM3+rUGFM/lfgooVR FTSMDHCleq1KEkssat6KGwSBrA0BftbNQBvA2NCf5Ge5aGRUqMbhgFxoTbeY29f5rO29 Og1bejlrZf7X68zCqn4tUaACwuhAwCEAr6vm5DTKj8VvTUXssq4HTKPbHyN5ojxqb+tr dtK9hxozQL9xSs+E1ABeHlWsolH1nYDzhNwUqOSLsUmm4GMffjcZJZAUYGRdq4zkFaC5 93Lj3TZKoxEhdlVaAIIMoBnoNEQULKwkA3xuDWZ5RTHYaGsG3qenQtErjChdwB8ubYmt pcsQ== X-Received: by 10.14.9.72 with SMTP id 48mr7321414ees.42.1375956284562; Thu, 08 Aug 2013 03:04:44 -0700 (PDT) Original-Received: by 10.14.133.15 with HTTP; Thu, 8 Aug 2013 03:04:04 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::233 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:162486 Archived-At: On Thu, Aug 8, 2013 at 6:09 AM, Stefan Monnier 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