From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: pjb@informatimago.com (Pascal J. Bourguignon) Newsgroups: gmane.emacs.help Subject: Re: One more question about elisp Date: Sun, 08 Nov 2009 17:01:06 +0100 Organization: Informatimago Message-ID: <87aayx9fb1.fsf@galatea.local> References: <53781544-57b8-4cde-a07a-c3632d8bac7f@a32g2000yqm.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1257698494 31161 80.91.229.12 (8 Nov 2009 16:41:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 Nov 2009 16:41:34 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Nov 08 17:41:27 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 1N7ApS-00073v-Tz for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Nov 2009 17:41:27 +0100 Original-Received: from localhost ([127.0.0.1]:48172 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7ApS-0007Ax-7v for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Nov 2009 11:41:26 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 66 Original-X-Trace: individual.net 1CsmzwDc3/4/LvH/uN20QAtwXpurMlyLTzOzRek68ZU0EQ4wNF Cancel-Lock: sha1:YjI2OWYxY2FmODUyMGQ0Nzg1NTFmNmRmNTQ3MmJhNzgwMGNjNTllZA== sha1:5RQfvSCthRoO6muq4ovhoHw1d5o= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (darwin) Original-Xref: news.stanford.edu gnu.emacs.help:174531 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:69606 Archived-At: Francis Moreau writes: > tomas@tuxteam.de writes: > > [...] > >> >> You have been pointed to "defstruct" already. From it info page: > > I realized this is not part of elips but clisp, that's why I missed it. There is no programming language named clisp. There is one named Common Lisp, which has several implementations, one of which is called clisp. But "clisp" is not the name of a programming language, it's the name of a program. > The weird thing (for now) is that "defstruct" is not very used in the > source code of emacs. > > Anyway, I'll keep trying to learn the basic concept of elisp. THE basic concept of all the languages in the lisp family, is that of the uniform syntax for data and code (symbolic expressions, sexp). This allows to easily write programs to transform programs, since programs are normal lisp data. Hence the notion of macro. This allows to easily extend the language to fit your needs, since the new operators you can implement with macros are indistinguishable from primitive operators. Apart from that, the exact primitive data types provided by a lisp system is rather irrelevant, given a few user level libraries providing the macros needed to define data abstractions you want. And if these libraries don't exist, no problem, you can easily write them yourself. In anycase, in a sizeable lisp program it is expected that you write yourself your own macros to define your own, application specific, language. So, yes, structures don't exist in the bare emacs lisp language. But this doesn't matter, since there is the cl package that provides a defstruct macro. If this package didn't exist, it wouldn't matter either, since you could easily write such a defstruct macro yourself. And in any case it doesn't matter, since in your application you'll be expected to define your own macro to define your own entities. (You may base your macro on defstruct, or you may base it on lower level emacs lisp vectors, or on cons cells, or whatever, it just does not matter). Read SICP! Structure and Interpretation of Computer Programs http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html http://swiss.csail.mit.edu/classes/6.001/abelson-sussman-lectures/ http://www.codepoetics.com/wiki/index.php?title=Topics:SICP_in_other_languages http://eli.thegreenplace.net/category/programming/lisp/sicp/ http://www.neilvandyke.org/sicp-plt/ -- __Pascal Bourguignon__