Newsgroups: comp.lang.scheme
From: Kyn@waichung.demon.co.uk (Kyn Wai Chung)
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!news.duke.edu!convex!cs.utexas.edu!news.sprintlink.net!peernews.demon.co.uk!waichung.demon.co.uk!Kyn
Subject: re:can you rectify this program
Distribution: world
Organization: Myorganisation
Reply-To: Kyn@waichung.demon.co.uk
X-Newsreader: Newswin Alpha 0.6
Lines:  28
X-Posting-Host: waichung.demon.co.uk
Date: Wed, 22 Feb 1995 07:32:13 +0000
Message-ID: <766334313wnr@waichung.demon.co.uk>
Sender: usenet@demon.co.uk



I have written the folowing program but it does not seem to work.Can 
anyboby make the program work.This program is supposed to prompt you 
for a string of text and a substring.It then compares the two and if it 
is a substring it will return continue? y/n, if not it will display 
Done.
 
 (define prog
   (lamnda ()
     (writeln "Please type in a string of text: ")
       (let ((strng (read)))
      (writeln "Please type in a substring: ")
        (let ((sstr (read)))
        (if (= #t (substring? sstr strng)
          (writeln "sstr is a substring of strng"))
          (writeln "sstr is not a substring of strng))))
        (writeln "Continue? y/n")
          (let ((response (read)))
            (if (eq? response 'n)
                (writeln "Done")
         (prog)))))

Substring? is a procedure which tests whether the string sstr is a 
substring of strng.

Kyn Wai Chung. 
