[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

return value of `string-set!'

From: Alexandru Cojocaru
Subject: return value of `string-set!'
Date: Thu, 15 Aug 2013 00:33:06 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8

currently `string-set!' returns an unspecified value. What about making it return `str' instead?

Here is an example of its use:

; make a copy of `str' and replace its first character with `#\a'
(define (make-copy str)
 (string-set! (string-copy str) 0 #\a))

instead of:

(define (make-copy str)
 (let ((s (string-copy str)))
    (string-set! s 0 #\a)

or perhaps I am doing something wrong?

PS: the documentation of `list-set!' doesn't say what's its return value.

Best regards,
Alexandru Cojocaru

reply via email to

[Prev in Thread] Current Thread [Next in Thread]