unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stephen J. Turnbull" <stephen@xemacs.org>
To: emacs-devel@gnu.org
Subject: opaque data types [revise and resend]
Date: Sat, 08 Jun 2013 15:28:00 +0900	[thread overview]
Message-ID: <874nd99kwf.fsf@uwakimon.sk.tsukuba.ac.jp> (raw)
In-Reply-To: <87sj0uqdhm.fsf_-_@lifelogs.com>

Oops, keyboard bounce; fix and resend.

Ted Zlatanov writes:

 > Generally, I love how Lisp balances readability, accessibility, and
 > power by limiting itself to data structures that are not opaque.  The
 > exceptions to that rule are the interesting edge cases :)

You mean exceptions like plists?

 > (By contrast, Java makes data structures and objects impenetrable
 > by default and requires nasty tricks to get introspection.

Introspection is a question of API design.  The Lisp that you love is
a trivial design.  There's one data structure: the cons.
Introspection is provided by the access functions and the repl.

On the other hand, you seem to like hash tables.  How do you
introspect the number of buckets and the hash function in Emacs?
Inquiring minds want to know!  Another example: XEmacs takes you
half-way there.  It displays the number of buckets in the un(read)able
print representation.  If bucket count were useful to programs, it
would be easy enough to provide an API.

So it's a question of how you balance the needs.  I'm certainly not
recommending use of Java over Lisp!  However, there are some common
structures like mappings that are well-served by opaque data types,
and some specialized ones like characters (!) and keymaps where Emacs
implementers are well-served.




  parent reply	other threads:[~2013-06-08  6:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-04 22:44 plist-based package.el (was Re: cl-defstruct-based package.el, now with ert tests and no external tar!) Daniel Hackney
2013-06-04 23:01 ` Dmitry Gutov
2013-06-05 14:53   ` Ted Zlatanov
2013-06-05 17:41     ` Stefan Monnier
2013-06-05 17:56       ` Drew Adams
2013-06-05 18:06         ` Ted Zlatanov
2013-06-06  9:30           ` Stephen J. Turnbull
2013-06-06 12:51             ` Ted Zlatanov
2013-06-07  3:07               ` Stephen J. Turnbull
2013-06-07 13:03                 ` opaque data types (was: plist-based package.el (was Re: cl-defstruct-based package.el, now with ert tests and no external tar!)) Ted Zlatanov
2013-06-07 13:27                   ` opaque data types Christopher Schmidt
2013-06-07 14:11                     ` Ted Zlatanov
2013-06-07 15:44                       ` Christopher Schmidt
2013-06-07 16:01                         ` Ted Zlatanov
2013-06-08  9:19                           ` Christopher Schmidt
2013-06-10  3:56                             ` Ted Zlatanov
2013-06-07 16:17                   ` Stefan Monnier
2013-06-07 17:48                     ` Ted Zlatanov
2013-06-08  6:11                   ` Stephen J. Turnbull
2013-06-08  6:28                   ` Stephen J. Turnbull [this message]
2013-06-10  4:00                     ` opaque data types [revise and resend] Ted Zlatanov
2013-06-05  1:34 ` plist-based package.el (was Re: cl-defstruct-based package.el, now with ert tests and no external tar!) Stefan Monnier
2013-06-06  1:31   ` Daniel Hackney
2013-06-08  6:47     ` Rand User

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874nd99kwf.fsf@uwakimon.sk.tsukuba.ac.jp \
    --to=stephen@xemacs.org \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).