[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.
- opaque data types (was: plist-based package.el (was Re: cl-defstruct-based package.el, now with ert tests and no external tar!)), (continued)
- 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
- Re: opaque data types, Christopher Schmidt, 2013/06/07
- Re: opaque data types, Ted Zlatanov, 2013/06/07
- Re: opaque data types, Christopher Schmidt, 2013/06/07
- Re: opaque data types, Ted Zlatanov, 2013/06/07
- Re: opaque data types, Christopher Schmidt, 2013/06/08
- Re: opaque data types, Ted Zlatanov, 2013/06/09
- Re: opaque data types, Stefan Monnier, 2013/06/07
- Re: opaque data types, Ted Zlatanov, 2013/06/07
- opaque data types, Stephen J. Turnbull, 2013/06/08
- opaque data types [revise and resend],
Stephen J. Turnbull <=
- Re: opaque data types [revise and resend], Ted Zlatanov, 2013/06/10
Re: plist-based package.el (was Re: cl-defstruct-based package.el, now with ert tests and no external tar!), Stefan Monnier, 2013/06/04