Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-04-03 (20:41)
From: Harrison, John R <john.r.harrison@i...>
Subject: RE: [Caml-list] Strings
| I can agree with you on this argument, but a question still remains:
| why should you ever do things like:
| > # s.[0] <- 'a';;

The point is that it might not be your own code that does it, but a
function written by someone else to which you innocently pass a string
argument. You may think you're writing purely functional code, but
unless you've checked all the other functions you're using that accept
or return strings, who knows?

Even if you aren't a doctrinaire functional programmer, the use of
mutable strings as the default weakens the abstraction boundary
provided by functions and procedures, and surely everyone agrees on
the importance of that.