emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

opaque data types [revise and resend]


From: Stephen J. Turnbull
Subject: opaque data types [revise and resend]
Date: Sat, 08 Jun 2013 15:28:00 +0900

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]