Subject: Re: More efficient alternatives to (subseq) for accessing parts of a string array?
From: rpw3@rpw3.org (Rob Warnock)
Date: Thu, 12 Apr 2007 20:02:59 -0500
Newsgroups: comp.lang.lisp
Message-ID: <EIWdnb82c5teS4PbnZ2dnUVZ_qOpnZ2d@speakeasy.net>
dpapathanasiou <denis.papathanasiou@gmail.com> wrote:
+---------------
| I'm using (read-sequence) within a (with-open-file) block to read a
| plain text file into a one-dimensional array.
...
| Once in memory, I'd like to be able to pick out lists of the same
| attribute that appears in each line of the file.
+---------------

In addition to other advice you've been given, I've found
the CL functions SEARCH, MISMATCH, POSITION, and POSITION-IF
to be *very* useful for doing non-consing string parsing.

Then, having found the bounding indices for the tokens
you're looking for, you can use either/both READ-FROM-STRING
or/and PARSE-INTEGER with the :START & :END keyword args
to further avoid using SUBSEQ.


-Rob

p.s. Don't forget ":JUNK-ALLOWED T" in PARSE-INTEGER calls,
when appropriate.

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