>>>>> "PT" == PT <[EMAIL PROTECTED]> writes:
PT> I'm writing a moderately complex Emacs package and not being a PT> Lisp guru I wonder what is the best way to handle data PT> structures in Elisp. The emphasis is not on efficiency, rather PT> on readability. PT> For example, from a function I want to return three values. How PT> should I do this? PT> Using a list? (Value1 Value2 Value3)? PT> This has the disadvantage of storing specific values on specific PT> positions, so the caller must now the first element of the list PT> is Value1, etc. And what if the return value is changed later PT> and Value2 is not returned anymore? Then I have to fix every PT> invocation of the function. PT> Or maybe an association list? '((value1 . 3) (value2 . 4) PT> (value3 . 5)) It's certainly more resistant to code changes, but PT> feels a bit heavyweight. (Maybe its just me.) PT> Or is there an other Lispish way to handle structured data I PT> don't know about? plists, or a hashtable would also work. Another solution would be to look at eieio, which gives you objects that you can then pass around. This doesn't directly answer your question, but it gets away from some of the nastiness of having multiply nested list structures. Phil _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs