From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Francis Moreau Newsgroups: gmane.emacs.help Subject: One more question about elisp Date: Fri, 6 Nov 2009 08:46:59 -0800 (PST) Organization: http://groups.google.com Message-ID: <53781544-57b8-4cde-a07a-c3632d8bac7f@a32g2000yqm.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1257529469 10377 80.91.229.12 (6 Nov 2009 17:44:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Nov 2009 17:44:29 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 06 18:44:22 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N6SrG-0004KD-A8 for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Nov 2009 18:44:22 +0100 Original-Received: from localhost ([127.0.0.1]:49863 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N6SrF-0001Dr-NW for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Nov 2009 12:44:21 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!postnews.google.com!a32g2000yqm.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-NNTP-Posting-Host: 213.215.4.82 Original-X-Trace: posting.google.com 1257526019 11887 127.0.0.1 (6 Nov 2009 16:46:59 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 6 Nov 2009 16:46:59 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a32g2000yqm.googlegroups.com; posting-host=213.215.4.82; posting-account=ekTE0goAAADiVCThPmo4ph0C5bTUhQOx User-Agent: G2/1.0 X-HTTP-Via: 1.1 grimoire.wyplay.int:3128 (squid/2.5.STABLE14) X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.11) Gecko/2009061118 Fedora/3.0.11-1.fc9 Firefox/3.0.11, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:174475 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:69554 Archived-At: Hello, I'm now wondering what is the elisp way to create structured objects and how to access them later. For example I want to create a structure/object which store information about a person. In C language, I would do something like this: structure person { int age; char *name; }; For an object oriented language, Python for example, I would do: class Person(object): def __init__(self, age, name): self.age = age self.name = name but how I do that in elisp ? Should I use a list ? That wouldn't be convenient for accessing the 'fields' of the object later since I need to use an index rather than a name field. Could anybody provide a pointer or any hints ? Thanks