From: Sam
Subject: Newbie questions
Date: 
Message-ID: <8mvfao$cgd$1@m3.pp.htv.fi>
I'm new to Lisp, and have some newbie questions.

How do you do string matching and parsing ? Eg. something similar to C's
sscanf, or regular expressions.

Can you do Haskell / ML / ... style guarded pattern matching with Lisp ? I
gather it's not available straight in the
language, but is there eg. a macro freely available to do it ?

I'm using CLISP.

Sam -- sam at pcuf dot fi

From: Rudolf Schlatte
Subject: Re: Newbie questions
Date: 
Message-ID: <lxhf8sq8lg.fsf@ist.tu-graz.ac.at>
"Sam" <···@pcuf.fi> writes:

> I'm new to Lisp, and have some newbie questions.

Welcome.

> How do you do string matching and parsing ? Eg. something similar to C's
> sscanf, or regular expressions.

There were some threads recently (last month or so) covering this;
Deja should still have them.  If you need a full-fledged Lexer/Parser,
have a look at Zebu (contact me by email; I still haven't got off my
lazy **** and packaged it up).

> Can you do Haskell / ML / ... style guarded pattern matching with Lisp ? I
> gather it's not available straight in the
> language, but is there eg. a macro freely available to do it ?

It is difficult to do this exactly as in ML, since Lisp and ML are
quite different in their treatment of types.  ML knows all datatypes
at compile time, so you can match patterns quite easily, destructuring
lists and so on and know (at compile time) that you do not miss a
case.

Lisp, on the other hand, knows the datatype of all objects (_not_
identifiers, but the actual data) at runtime.  Depending on what you
need, you can perhaps use one of: destructuring-bind, typecase,
case, cond.  Also look at generic functions and their ability to
dispatch on your objects, Lisp datatypes and single objects.

If you are new to Lisp, you have perhaps not heard yet about the
HyperSpec.  This is extremely helpful, look at
<http://www.xanalys.com/software_tools/reference/HyperSpec/>.

Rudi
From: Paolo Amoroso
Subject: Re: Newbie questions
Date: 
Message-ID: <WeuTOTfwZ6dBlDFzzTnQ+oTAKo9E@4ax.com>
On Fri, 11 Aug 2000 02:50:17 +0300, "Sam" <···@pcuf.fi> wrote:

> I'm new to Lisp, and have some newbie questions.

I suggest that you check this online book by David Lamkins:

  Successful Lisp
  http://psg.com/~dlamkins/left/sl/sl.html


Paolo
-- 
EncyCMUCLopedia * Extensive collection of CMU Common Lisp documentation
http://cvs2.cons.org:8000/cmucl/doc/EncyCMUCLopedia/