From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Katalin Sinkov Newsgroups: gmane.emacs.help Subject: Re: lisp style question Date: Thu, 2 Dec 2010 17:11:06 -0800 (PST) Organization: http://groups.google.com Message-ID: <6e2fe51c-ff4c-429f-b221-a3cbe23e958f@n2g2000pre.googlegroups.com> References: <82vd3ceexc.fsf@shevek.netfonds.no> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1291950029 22448 80.91.229.12 (10 Dec 2010 03:00:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Dec 2010 03:00: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 Dec 10 04:00:19 2010 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.69) (envelope-from ) id 1PQtDW-0005s9-LK for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Dec 2010 04:00:18 +0100 Original-Received: from localhost ([127.0.0.1]:45897 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQtDW-0007vH-0z for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 22:00:18 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!n2g2000pre.googlegroups.com!not-for-mail Original-Newsgroups: comp.lang.lisp,comp.emacs,gnu.emacs.help Original-Lines: 52 Original-NNTP-Posting-Host: 75.31.79.167 Original-X-Trace: posting.google.com 1291338666 8535 127.0.0.1 (3 Dec 2010 01:11:06 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 3 Dec 2010 01:11:06 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: n2g2000pre.googlegroups.com; posting-host=75.31.79.167; posting-account=q8u0hAoAAAA7uZRsDFj29PQdwm_l8nyT User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6,gzip(gfe) Original-Xref: usenet.stanford.edu comp.lang.lisp:296029 comp.emacs:100881 gnu.emacs.help:182781 X-Mailman-Approved-At: Thu, 09 Dec 2010 20:08:58 -0500 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:77240 Archived-At: On Dec 2, 12:50=A0am, "Frode V. Fjeld" wrote: > Katalin Sinkov writes: > > In the {} world I would return a small table like > > > width =A0 1 > > height =A02 > > weight =A03 > > Typically in Lisp you'd return either a property or association list. > > I.e: (WIDTH 1 HEIGHT 2 WEIGHT 3) with accessor GETF, > > or ((WIDTH . 1) (HEIGHT . 2) (WEIGHT . 3)) with accessor ASSOC. > > -- > Frode V. Fjeld Of all the four or five replies, I found yours most helpful although brief. This is perhaps due to me being a beginner, although the replies seem very promising and I am desirous of understanding them. I have just read the paper by McCarthy and the micro manual. assoc. and pair. are the most elementary of the functions, although not primitive and used in evaluator for working the symbol table. but beyond this, i could not understand your post. what is an "assoc list" and "a property list" and their difference ? what is "setf" and how to write it in terms of the elementary functions, car/cdr/cons/quote/cond/atom/eq ? how to conveniently costruct the list that goes with getf ? Presently I use the emacs IDE only and restricted to elisp, though i can (require 'cl) so what are the correponding operation in elisp ? what are the corresponding functions to defclass/defstruct in elisp ? I assume people are assuming CL. Could you comment a little on the post of Captain Obvious and Pascal Bourguignon ? The former has "values" and the latter has "make-volume" and colons. How did the constructor "make-volume" come to be ? Is it a feature in elisp ? Thanks for your help. Katalin