> 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 .
> I have a question on doing character comparison
> 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
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=)
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.
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) ...)?