From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.help Subject: Re: List-of-lists data structure Date: Sun, 13 Apr 2014 10:13:15 +0200 Message-ID: <87ha5x7ilg.fsf@zigzag.favinet> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1397376579 25099 80.91.229.3 (13 Apr 2014 08:09:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 13 Apr 2014 08:09:39 +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 Apr 13 10:09:32 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WZFTo-0001re-Aa for geh-help-gnu-emacs@m.gmane.org; Sun, 13 Apr 2014 10:09:32 +0200 Original-Received: from localhost ([::1]:37008 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZFTn-0001D0-8V for geh-help-gnu-emacs@m.gmane.org; Sun, 13 Apr 2014 04:09:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZFTS-0001CD-UI for help-gnu-emacs@gnu.org; Sun, 13 Apr 2014 04:09:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WZFTL-0000df-FC for help-gnu-emacs@gnu.org; Sun, 13 Apr 2014 04:09:10 -0400 Original-Received: from smtp205.alice.it ([82.57.200.101]:21310) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZFTL-0000da-3B for help-gnu-emacs@gnu.org; Sun, 13 Apr 2014 04:09:03 -0400 Original-Received: from zigzag.favinet (82.48.1.252) by smtp205.alice.it (8.6.060.28) id 529A59311D47A88E for help-gnu-emacs@gnu.org; Sun, 13 Apr 2014 10:09:01 +0200 Original-Received: from ttn by zigzag.favinet with local (Exim 4.80) (envelope-from ) id 1WZFXc-00075w-4W for help-gnu-emacs@gnu.org; Sun, 13 Apr 2014 10:13:28 +0200 Mail-Followup-To: help-gnu-emacs@gnu.org In-Reply-To: (Jacob Gerlach's message of "Sat, 12 Apr 2014 09:46:47 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 82.57.200.101 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:97115 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable () Jacob Gerlach () Sat, 12 Apr 2014 09:46:47 -0400 (setq name-and-keyword-list '("pFoo" ("foo" "bar" "baz"))) Here, note that the car of =E2=80=98name-and-keyword-list=E2=80=99 is indee= d "pFoo", a single string, while the cdr is =E2=80=98(("foo" "bar" "baz"))=E2=80=99, a = list of one element, a sub-list of three string elements. Is that what you want? (setq name-and-keyword-list '("pFoo" ("foo" "bar" "baz")) '("pBar" ("apples" "pears" "orange"))) Is this a simple syntax error, or am I approaching this data structure in the wrong way? Yes. :-D In the =E2=80=98setq=E2=80=99 docstring (via =E2=80=98C-h f setq RET=E2=80= =99), the prototype is: (setq [SYM VAL]...) which on first blush seems to imply that multiple VAL are possible, due to the ellipses at the end of the form. But that's not right! You have to distribute the ellipses properly, kind of like (A+D)C =3D> AC+DC. The upshot is that each SYM has its own VAL. That's the syntax error part. The approaching the data structure in the wrong way part is a matter of pov. When you teach someone to dance, maybe left is right but right is wrong (and maybe not!). I think Perlis would appreciate your focus. =2D-=20 Thien-Thi Nguyen GPG key: 4C807502 (if you're human and you know it) read my lisp: (responsep (questions 'technical) (not (via 'mailing-list))) =3D> nil --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlNKRyEACgkQZwMiJEyAdQJEPgCdEDXxsKwYlpQvJkhZ100W+3Ig M9IAn3wjgy+D3aHQlLjUMRjZRTVi4Ihs =3Mha -----END PGP SIGNATURE----- --=-=-=--