From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Maciek Godek" Newsgroups: gmane.lisp.guile.user Subject: Re: References/locations Date: Mon, 18 Aug 2008 10:09:50 +0200 Message-ID: References: <87bpzu1ixq.fsf@unknownlamer.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1219047016 23534 80.91.229.12 (18 Aug 2008 08:10:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Aug 2008 08:10:16 +0000 (UTC) Cc: guile-user@gnu.org, "Kjetil S. Matheussen" To: "Clinton Ebadi" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Aug 18 10:11:08 2008 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KUzpM-0003bp-Gm for guile-user@m.gmane.org; Mon, 18 Aug 2008 10:11:00 +0200 Original-Received: from localhost ([127.0.0.1]:33560 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KUzoP-0005Wt-DG for guile-user@m.gmane.org; Mon, 18 Aug 2008 04:10:01 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KUzoL-0005We-7c for guile-user@gnu.org; Mon, 18 Aug 2008 04:09:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KUzoJ-0005WS-Jl for guile-user@gnu.org; Mon, 18 Aug 2008 04:09:56 -0400 Original-Received: from [199.232.76.173] (port=41303 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KUzoJ-0005WP-FJ for guile-user@gnu.org; Mon, 18 Aug 2008 04:09:55 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:46991) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KUzoJ-0007y9-LD for guile-user@gnu.org; Mon, 18 Aug 2008 04:09:55 -0400 Original-Received: from wf-out-1314.google.com ([209.85.200.171]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KUzoH-0006mC-03 for guile-user@gnu.org; Mon, 18 Aug 2008 04:09:53 -0400 Original-Received: by wf-out-1314.google.com with SMTP id 28so2028768wfc.24 for ; Mon, 18 Aug 2008 01:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=WPKCEQztzS7DRukPxkV0x1Imu8H34L1wDTYVYquCQPk=; b=ulH30fBh5KEBCXnbq4vcbzqZcvRw6Z490STlJHc8gsKKSy3dDovPxp59Fj+iTZxX1V 0FaBcikHHm87mC69DfibQyW4SVR0O4ZR1z4bkQPZskVcIaq9avmDupAVTJr2WFwc4LwX DI/Dgbc1CMOVQjrXFWdDnnQkUuhH3RXdtDMG0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=ISD1TSaBFWlseqJvKxwZEd+jdlLmrDcImKnudPS/yWqCTaP19Ey5G9ZxKniUZNdzs4 udC2UED5itppEFbCOUGVMo7tIwjsq2Lt1/aF3bAz48GKLr9jKJPvebtOFBW6qk+TNvos KM9VK4j+O1Nt3hctYo7Ni0ifHvunNpZPe9ZkE= Original-Received: by 10.143.5.7 with SMTP id h7mr1941907wfi.319.1219046990730; Mon, 18 Aug 2008 01:09:50 -0700 (PDT) Original-Received: by 10.142.164.4 with HTTP; Mon, 18 Aug 2008 01:09:50 -0700 (PDT) In-Reply-To: <87bpzu1ixq.fsf@unknownlamer.org> Content-Disposition: inline X-detected-kernel: by mx20.gnu.org: Linux 2.6 (newer, 2) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:6751 Archived-At: Clinton Ebadi: >> I've been thinking of implementing this "location" stuff >> as a smob, but you've got the point that it is (probably) >> impossible to implement the location system without >> redefining set! and define. > > You may want to read a few documents on functional programming to see > why your locations concept is not good. There are a number of > additional issues as well: one that comes to mind is the interaction > of the garbage collector with pointers into the middle of a vector. That's what I wanted to hear :) (The other thing is the ambiguity: if we create a location to another variable, say (set! y (location x)), then we can't redefine the meaning of y easily: (set! y 5) ; sets x to 5, which is unexpected behavior of set! I think there would be many many more disadvantages) > What is so wrong with forms like `(set! (vector-ref foo index) ...)'? In scheme the only problem is that they don't work, unless we redefine vector-ref: (define vector-get vector-ref) (define vector-ref (make-procedure-with-setter vector-get vector-set!)) > It's generally bad practice to go around destructively modifying data > structures anyway. Perhaps I'm not an experienced lisper, but I'd rather say it's generally a bad practice to generalize overly: everything depends on what you're doing. I'm currently working on an object system that is based on a local state and it would be a stubbornness to implement it using purely functional paradigm. Regards M.