From: Marius Vollmer <mvo@zagadka.de>
Cc: guile-user@gnu.org, guile-devel@gnu.org
Subject: Re: overriding car/cdr
Date: Sat, 20 Mar 2004 23:28:02 +0100 [thread overview]
Message-ID: <87wu5fnogd.fsf@zagadka.ping.de> (raw)
In-Reply-To: <m3wu6x47eo.fsf@multivac.cwru.edu> (Paul Jarc's message of "Sun, 08 Feb 2004 15:56:09 -0500")
prj@po.cwru.edu (Paul Jarc) writes:
> Marius Vollmer <mvo@zagadka.de> 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
next prev parent reply other threads:[~2004-03-20 22:28 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-16 9:41 Worrying development Roland Orre
2004-01-16 11:59 ` tomas
2004-01-18 21:05 ` Marius Vollmer
2004-01-18 21:58 ` Tom Lord
2004-01-22 21:47 ` Tom Lord
2004-01-22 16:11 ` Dirk Herrmann
2004-01-22 18:42 ` Tom Lord
2004-01-23 11:45 ` Dirk Herrmann
2004-01-23 17:16 ` Tom Lord
2004-01-23 21:01 ` Marius Vollmer
2004-01-23 22:18 ` Tom Lord
2004-01-24 0:27 ` Marius Vollmer
2004-01-24 0:53 ` Tom Lord
2004-01-23 22:28 ` Paul Jarc
2004-01-24 12:09 ` rm
2004-01-24 13:29 ` Marius Vollmer
2004-01-26 2:42 ` overriding car/cdr (was: Worrying development) Paul Jarc
2004-02-08 16:21 ` overriding car/cdr Dirk Herrmann
2004-02-08 18:09 ` Marius Vollmer
2004-02-08 20:56 ` Paul Jarc
2004-03-20 22:28 ` Marius Vollmer [this message]
2004-03-22 17:05 ` David Van Horn
2004-03-22 21:03 ` Marius Vollmer
2004-03-22 17:24 ` Paul Jarc
2004-01-23 22:37 ` Worrying development Dirk Herrmann
2004-01-23 23:25 ` Tom Lord
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wu5fnogd.fsf@zagadka.ping.de \
--to=mvo@zagadka.de \
--cc=guile-devel@gnu.org \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).