Re: need a little scheme help

Subject: Re: need a little scheme help
From: Dave Love <>
Date: 12 Oct 1998 20:27:46 +0100
>>>>> "Bas" == Bas Peters <bpeters@xxxxxx> writes:

 Bas> It removes the last character if the last character is a semi colon. I
 Bas> would like to add a few OR statements, like this:

 Bas> if ... ";" OR ":" OR "."

I'd write a function something like this and call it in the
appropriate place(s).  [I wouldn't use such *names* for functions.]

(define (strip-trailing-punctuation s)
  (let ((ls-1 (- (string-length s) 1)))
      (case (string-ref s ls-1)
	((#\; #\. #\,) (substring s 0 ls-1))
	(else s))))

 Bas> May be I should order a usefull Scheme book.

Harvey and Wright, `Simply Scheme' presents something like the
DSSSL-relevant subset of Scheme in a leisurely way, if that's what you

 DSSSList info and archive:

Current Thread