From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Something like an array (list) of a class Date: Sun, 12 Apr 2009 10:45:54 -0700 Message-ID: <000701c9bb96$87d065c0$0200a8c0@us.oracle.com> References: <665d0b7a-3230-4123-b9f4-2a645f44dd1c@a7g2000yqk.googlegroups.com><9fe617de-13d8-4dbc-82f8-3cc575008e48@o18g2000vbi.googlegroups.com><87tz4ub8ow.fsf@tux.homenetwork><001401c9bb89$e18f0510$0200a8c0@us.oracle.com> <878wm5sshm.fsf@tux.homenetwork> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1239558387 30700 80.91.229.12 (12 Apr 2009 17:46:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 12 Apr 2009 17:46:27 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Apr 12 19:47:45 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lt3mP-0004U8-U4 for geh-help-gnu-emacs@m.gmane.org; Sun, 12 Apr 2009 19:47:42 +0200 Original-Received: from localhost ([127.0.0.1]:41473 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lt3l1-0002Fu-8R for geh-help-gnu-emacs@m.gmane.org; Sun, 12 Apr 2009 13:46:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lt3kc-0002E6-Ae for help-gnu-emacs@gnu.org; Sun, 12 Apr 2009 13:45:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lt3kX-00028I-9Z for help-gnu-emacs@gnu.org; Sun, 12 Apr 2009 13:45:49 -0400 Original-Received: from [199.232.76.173] (port=45529 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lt3kW-00028C-UT for help-gnu-emacs@gnu.org; Sun, 12 Apr 2009 13:45:44 -0400 Original-Received: from acsinet12.oracle.com ([141.146.126.234]:47713) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lt3kW-0000ei-D7 for help-gnu-emacs@gnu.org; Sun, 12 Apr 2009 13:45:44 -0400 Original-Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by acsinet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n3CHj5JK022110 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 12 Apr 2009 17:45:06 GMT Original-Received: from acsmt706.oracle.com (acsmt706.oracle.com [141.146.40.84]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n3CHjdqZ018033; Sun, 12 Apr 2009 17:45:41 GMT Original-Received: from dradamslap1 (/141.144.64.172) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 12 Apr 2009 10:45:32 -0700 X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 In-Reply-To: <878wm5sshm.fsf@tux.homenetwork> Thread-Index: Acm7k3S+WT0vL2CNSeKyq/Nl2h5omQAACFHw X-Source-IP: acsmt706.oracle.com [141.146.40.84] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A0B0206.49E228BE.01B0:SCFMA4539814,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:63697 Archived-At: > > One thing you might also consider (again, depending on what > > you need/want), is that Emacs Lisp does provide a > > type-checking mechanism - in the context of > > Customize. This is often overlooked or under-exploited. > > Customize options can be complex structures whose parts > > are well typed, and compile-time and runtime > > type-checking are available. In addition, you can define > > initialization and set/put methods/triggers. > > > > Whether you want to use options for your data structures in > > general is another question. You would be exploiting the > > type-definition and type-checking features > > of Customize without necessarily wanting to create > > user-visible options. But this type manipulation is an > > existing and powerful Emacs-Lisp feature that you > > can use in ways other than those originally intended. > > Very interesting, did you already use this kind of mechanism > in some of your programs ? I haven't tried to implement data-driven or object-oriented programming in Emacs Lisp. I do take advantage of Customize type definition and type-checking, but so far only in the context of real user options. And I do use some options that users are not expected to modify using the Customize UI (rather, they use particular commands that I provide, to do that). In general, the Customize UI is one thing, and the Customize infrastructure is another. I suspect that many Emacs-Lisp programmers, disliking the UI, miss taking advantage of its variable defining and modifying infrastructure. >From my point of view, I don't care whether a user uses the UI or `setq' in an init file. I use `defcustom' largely for its detailed type-defining features, which are not bad. But so far I've done so only for real user options. A few of the `defcustom' definitions in Icicles might be of interest: http://www.emacswiki.org/emacs/icicles-opt.el. But I don't claim to be an expert on Customize definitions. I'm sure you can find other, and more interesting, `defcustom' definitions as food for thought. One place to look is the Emacs source files.