From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.lisp.guile.devel Subject: Re: Guile: What's wrong with this? Date: Thu, 05 Jan 2012 21:24:48 +0100 Organization: Organization?!? Message-ID: <87ipkpzylr.fsf@fencepost.gnu.org> References: <4F027F35.5020001@gmail.com> <1325603029.22166.YahooMailNeo@web37906.mail.mud.yahoo.com> <4F032C41.3070300@gmail.com> <87mxa4ifux.fsf@gnu.org> <4F038BF4.1070200@gnu.org> <87obujzmmc.fsf@Kagami.home> <4F048972.5040803@gnu.org> <87lipnm8yx.fsf@Kagami.home> <4F04D01D.5050801@gnu.org> <8762grf28k.fsf@netris.org> <4F05DC47.1000202@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1325795125 25559 80.91.229.12 (5 Jan 2012 20:25:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 5 Jan 2012 20:25:25 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Jan 05 21:25:15 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Rits8-00044B-9X for guile-devel@m.gmane.org; Thu, 05 Jan 2012 21:25:12 +0100 Original-Received: from localhost ([::1]:58249 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rits7-00025V-HS for guile-devel@m.gmane.org; Thu, 05 Jan 2012 15:25:11 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:48397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rits3-000239-Bt for guile-devel@gnu.org; Thu, 05 Jan 2012 15:25:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rits1-0007B6-PH for guile-devel@gnu.org; Thu, 05 Jan 2012 15:25:07 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:37422) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rits1-00079e-6c for guile-devel@gnu.org; Thu, 05 Jan 2012 15:25:05 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ritrx-0003ys-IQ for guile-devel@gnu.org; Thu, 05 Jan 2012 21:25:01 +0100 Original-Received: from p508ebb89.dip.t-dialin.net ([80.142.187.137]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 Jan 2012 21:25:01 +0100 Original-Received: from dak by p508ebb89.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 Jan 2012 21:25:01 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 51 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: p508ebb89.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) Cancel-Lock: sha1:4SwfrqmoGRy64ui4FvXemccxBNI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13331 Archived-At: Bruce Korb writes: > On 01/04/12 15:59, Mark H Weaver wrote: >> Implementing copy-on-write transparently without the user explicitly >> making a copy (that is postponed) is _impossible_. The problem is that >> although we could make a new copy of the string, we have no way to know >> which pointers to the old object should be changed to point to the new >> one. We cannot read the user's mind. > > So because it might be the case that one reference might want to > see changes made via another reference then the whole concept is > trashed? Yes. Because different references can't be distinguished, it would mean that you'd not actually have a reference to the modified copy after modifying it. Which renders the modification useless. > "all or nothing"? Anyway, such a concept should be kept very simple: > functions that modify their argument make copies of any input argument > that is read only. Any other SCM's lying about that refer to the > unmodified object continue referring to that same unmodified object. > No mind reading required. > (define a "hello") > (define b a) > (string-upcase! a) > b > > yields "hello", not "HELLO". Simple, comprehensible and, of course, > not the problem I was having. :) It is neither simple, nor comprehensible. > "it goes without saying (but I'll say it anyway)": > > (define a (string-copy "hello")) > (define b a) > (string-upcase! a) > b > > *does* yield "HELLO" and not "hello". Why the inconsistency? > > Because it is better to do what is almost certainly expected > rather than throw errors. > > It is an ease of use over language purity thing. You probably don't realize how ironic that is. -- David Kastrup