Jon Wilson wrote:

Is there any reason [string-append! returns] the unspecified value as opposed to returning str1 (post-modification)?

Most other mutating functions return the unspecified value.

It seems that returning str1 would be more useful to a functional programming style.

Maybe.  On the other hand it seems cleaner to distinguish between
"functional functions" versus "mutating functions".  Having the
latter return the first parameter seems to confuse the issue.

On the third hand, would could use a "linear" style where a data
structure has a single reference so a pure functional expression
can can safely modify objects in-place..

Additionally, this would make it a drop-in replacement for the existing string-append, in cases where modification of str1 is not harmful.

Also, a string-append! that returns the buffer can be a drop-in
replacement for SRFI-13s string-append/shared.
--
        --Per Bothner
[EMAIL PROTECTED]   http://per.bothner.com/

_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to