> Hi all,
> I am a newbie in lisp programming ...
Make sure you have a Common Lisp reference handy.
The ANSI CL standard is available in a hypertextified
version. Another source of wisdom is CLtL2 (Common Lisp
the Language, 2nd edition) - also available as hypertext.
For more information about Lisp visit http://www.lisp.org .
> and
> I have a question on doing character comparison
> eg
>
> how do I check if character 'a' is in word 'banada'
>
> is any thing like substring() function ?
FIND item sequence &key :from-end :test :test-not :start
:end :key
[Function]
returns the first element in the specified portion of sequence that
matches item according to test, or nil if no element matches.
? (find #\a "BANANA" :test #'char=)
NIL
Rainer Joswig, ISION Internet AG, Harburger Schlossstraße 1,
21079 Hamburg, Germany, Tel: +49 40 77175 226
Email: rainer...@ision.de , WWW: http://www.ision.de/
yes. FIND, POSITION, SEARCH, CHAR, SUBSEQ, etc.
note that most operations on characters and strings in Common Lisp are
simply special cases of operations on elements and sequences. many
C-based programmers are frustrated because they think that Common Lisp
has few string-handling functions. Common Lisp has few string-only
functions, so remember to look for sequence and array functions, too.
#:Erik
As long as we're on the subject, what is the best way to iterate over
a string/sequence? (map nil ... s)? (dotimes (i (length s)) ...
(char s i) ...)?
E.