From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marius Vollmer Newsgroups: gmane.lisp.guile.user,gmane.lisp.guile.devel Subject: Re: overriding car/cdr Date: Sat, 20 Mar 2004 23:28:02 +0100 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <87wu5fnogd.fsf@zagadka.ping.de> References: <1074246064.6729.23.camel@localhost> <87vfn9ufvw.fsf@zagadka.ping.de> <400FF648.3080706@dirk-herrmanns-seiten.de> <200401221842.KAA20956@morrowfield.regexps.com> <40110961.1040808@dirk-herrmanns-seiten.de> <200401231716.JAA26107@morrowfield.regexps.com> <87oesus7kg.fsf@zagadka.ping.de> <20040124120954.GB6589@www> <87k73hpj9n.fsf@zagadka.ping.de> <87znbtbfzt.fsf@zagadka.ping.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1079821880 10417 80.91.224.253 (20 Mar 2004 22:31:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 20 Mar 2004 22:31:20 +0000 (UTC) Cc: guile-user@gnu.org, guile-devel@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Mar 20 23:31:05 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1B4ozh-0006yu-00 for ; Sat, 20 Mar 2004 23:31:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B4ozF-00082P-6d for guile-user@m.gmane.org; Sat, 20 Mar 2004 17:30:37 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B4oz8-00081n-3Q for guile-user@gnu.org; Sat, 20 Mar 2004 17:30:30 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B4oyb-0007wV-Cp for guile-user@gnu.org; Sat, 20 Mar 2004 17:30:28 -0500 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.30) id 1B4oya-0007vx-SY for guile-user@gnu.org; Sat, 20 Mar 2004 17:29:56 -0500 Original-Received: from [195.253.8.218] (helo=mail.dokom.net) by mx20.gnu.org with esmtp (Exim 4.30) id 1B4owo-00013Y-Sg for guile-user@gnu.org; Sat, 20 Mar 2004 17:28:06 -0500 Original-Received: from dialin.speedway15.dip57.dokom.de ([195.253.15.57] helo=zagadka.ping.de) by mail.dokom.net with smtp (Exim 3.36 #3) id 1B4oya-0000Mz-00 for guile-user@gnu.org; Sat, 20 Mar 2004 23:29:56 +0100 Original-Received: (qmail 3904 invoked by uid 1000); 20 Mar 2004 22:28:02 -0000 Original-To: rm@fabula.de In-Reply-To: (Paul Jarc's message of "Sun, 08 Feb 2004 15:56:09 -0500") User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:2953 gmane.lisp.guile.devel:3538 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3538 prj@po.cwru.edu (Paul Jarc) writes: > Marius Vollmer wrote: >> But car/cdr are not a good way to work with general sequences. Think >> of vectors. > > car/cdr certainly can be made to work with vectors. [...] Yes, but would that be a _good_ way to work with them? It would be, in my view, only a kluge to make routines work with vectors that were originally written for lists. Such automatic code reuse or rather code-napping doesn't sound like a good idea to me. >> Somehthing like the 'sequence' concept of Common Lisp is a better >> approach, I'd say. > > AFAICT, that would involve a whole new set of procedures to work with > this new data type. I'm suggesting modifying the existing procedures > so that most existing code would automatically be able to take > advantage of the new flexibility, with no further changes needed. What would the advantage be? Some of the existing list routines will sort of work with vectors, but vectors are not lists, and the results will be strange at best. Lists in Scheme and Lisp are not merely sequences, they are able to form general trees with all kinds of intentional structure sharing. Vectors are not at all like this. What would is (cons (car vec) (cdr vec))? A pair with a vector as its second argument? A vector? Some lists are uses as sequences and it would indeed make sense to formalize this by introducing an abstract 'sequence' type for this, I'd say. Maybe by going over SRFI-1 and picking out the procedures that treat lists as sequences. Maybe such a thing already exists. -- GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405 _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user