From: Daniel Llorens <daniel.llorens@bluewin.ch>
To: Panicz Maciej Godek <godek.maciek@gmail.com>
Cc: "guile-user@gnu.org" <guile-user@gnu.org>
Subject: Re: name an array function
Date: Mon, 21 Nov 2016 15:38:02 +0100 [thread overview]
Message-ID: <A1672290-3320-4272-8181-3BA279B128FF@bluewin.ch> (raw)
In-Reply-To: <CAMFYt2a_Ge9JYpyNrxsTzX6ytf9uhPWSxrX1ZJeero57170PUg@mail.gmail.com>
On 21 Nov 2016, at 15:01, Panicz Maciej Godek <godek.maciek@gmail.com> wrote:
> As far as accessors are concerned, I'm not sure whether they actaully need names. Maybe it would be better to make them applicable, and produce "procedures with setters"?
I'd absolutely prefer (A i j) to (array-whatever A i j). Arrays *are* functions of indices.
But the mechanism for applicable objects isn't being used right now for any of the data structures with accessors. It isn't documented in the manual, either. I don't know how it works. Some patches are needed there, examples. Moreover if the type of arrays is changed (which I believe is needed to make arrays an applicable object), then we must retain compatibility with all the existing array procedures. I like the idea, but I don't think it's going to happen for 2.2.
Procedures with setters would remove the need for the modifying function (array-slice-copy! or whatever it ends up being called), but this isn't done now even for the pair array-ref / array-set!. However it is easier to implement.
My idea has always been to move the array descriptor (storage pointer, strides, etc), which is now an opaque C object, to Scheme. Then we could do lots of stuff without having to rebuild Guile, take advantage of compiler optimizations, etc. But even that isn't in the cards for 2.2. At least I don't think anyone is working on it.
prev parent reply other threads:[~2016-11-21 14:38 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-21 10:32 name an array function Daniel Llorens
2016-11-21 12:37 ` Stefan Israelsson Tampe
2016-11-21 12:55 ` tomas
2016-11-21 13:10 ` Daniel Llorens
2016-11-21 13:24 ` tomas
2016-11-21 13:42 ` Daniel Llorens
2016-11-21 13:56 ` tomas
2016-11-23 16:07 ` Daniel Llorens
2016-11-23 20:32 ` tomas
2016-11-23 20:48 ` David Pirotte
2016-12-15 11:12 ` Daniel Llorens
2016-12-15 11:30 ` tomas
2016-11-21 14:01 ` Panicz Maciej Godek
2016-11-21 14:38 ` Daniel Llorens [this message]
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=A1672290-3320-4272-8181-3BA279B128FF@bluewin.ch \
--to=daniel.llorens@bluewin.ch \
--cc=godek.maciek@gmail.com \
--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).