··········@righto.com (Ken Shirriff) writes:
> I read Paul Grahams's essays and have decided to try using Lisp. I'd
> like to find out how to use Lisp for tasks I typically do in, say,
> Python. Here are some examples:
>
> a) Open all files with the suffix ".abc". Look for all lines that
> contain a particular regular expression and print the matching parts.
http://www.lispworks.com/reference/HyperSpec/
DIRECTORY
MAKE-PATHNAME
DOLIST
WITH-OPEN-FILE
FORMAT
In clisp:
http://clisp.cons.org/impnotes/
REGEXP:MATCH
REGEXP-MATCH-STRING
> b) Read an XML file and print out all the text entities.
About the same list as above.
I would fetch a library to read XML, or use Zebu to write a parser...
Search them on http://www.cliki.net/
> c) Fetch a given web page, extract the links, and pipe the results
> into an external command.
In clisp:
See the implementation notes about the SOCKET package and EXT:RUN-PROGRAM.
> I really don't know where to begin to solve these tasks using Lisp.
> The Common Lisp Hyper Spec and the Lisp books I looked at discuss
> "pure" Lisp programming, rather than the kinds of problems I need to
> solve. I think what I need is O'Reilly's "Lisp in a Nutshell" except
> they don't publish it.
>
> So can someone point me at the documentation, book, or libraries I
> should be using?
>
> (I'm running Lisp in a box on Windows XP, but could run a Linux
> version of Lisp instead.)
>
> Thanks for any help,
> Ken Shirriff
--
__Pascal Bourguignon__ http://www.informatimago.com/
Voting Democrat or Republican is like choosing a cabin in the Titanic.