all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <thierry.volpiatto@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: RE: Something like an array (list) of a class
Date: Sun, 12 Apr 2009 10:45:54 -0700	[thread overview]
Message-ID: <000701c9bb96$87d065c0$0200a8c0@us.oracle.com> (raw)
In-Reply-To: <878wm5sshm.fsf@tux.homenetwork>

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





  reply	other threads:[~2009-04-12 17:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-10 20:32 Something like an array (list) of a class Decebal
2009-04-11  8:08 ` thierry.volpiatto
     [not found] ` <mailman.5118.1239437738.31690.help-gnu-emacs@gnu.org>
2009-04-12  7:25   ` Decebal
2009-04-12  8:03     ` thierry.volpiatto
2009-04-12 16:15       ` Drew Adams
2009-04-12 17:15         ` thierry.volpiatto
2009-04-12 17:45           ` Drew Adams [this message]
     [not found]     ` <mailman.5186.1239523825.31690.help-gnu-emacs@gnu.org>
2009-04-13  8:53       ` Decebal
2009-04-13 11:55         ` Decebal
2009-04-13 12:27           ` Decebal
2009-04-13 14:56           ` Decebal
2009-04-13 17:57             ` Decebal
2009-04-14  0:52               ` Barry Margolin
2009-04-14  4:44                 ` Decebal

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='000701c9bb96$87d065c0$0200a8c0@us.oracle.com' \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=thierry.volpiatto@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 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.