Subject: Re: Lisp newbie, data structures, parsing.
From: rpw3@rpw3.org (Rob Warnock)
Date: Tue, 03 Jan 2006 23:22:23 -0600
Newsgroups: comp.lang.lisp
Message-ID: <W7-dnRVcgu4SxibeRVn-gw@speakeasy.net>
Pascal Bourguignon  <spam@mouse-potato.com> wrote:
+---------------
| "Stefan Kamphausen" <skampi@gmx.de> writes:
| > Is there any idiomatic way to acces -say- ALLIANCE/STARTDATE/MONTH
| > easily?
| 
| It's rather trivial to walk a tree given a path.
| 
| (defun walk (tree path)  ... )
+---------------

Pascal,

Quite coincidentally, today I needed to do a bit of data extraction
from some hardware-design EDIF format files -- which are just single
huge s-exprs of the form (ELEMENT-NAME [OPTIONAL-LABEL] ELEMENTS...) --
and the notion of a PATH argument was just the hint I needed!

Thanks!!


-Rob

p.s. I extended my PATHs to allow both element-names and
lists of (ELEMENT-NAME LABEL), but it was equally trivial to
walk, once the notion of a "path" in the API was suggested.]

p.p.s. Hint: For best results working with EDIFs, do
a (setf (readtable-case *readtable*) :invert) first.  ;-}

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607