From: Marius Vollmer <marius.vollmer@uni-dortmund.de>
Subject: Re: Uniform vectors, user survey
Date: Thu, 04 Nov 2004 18:48:38 +0100 [thread overview]
Message-ID: <lju0s5o689.fsf@troy.dt.e-technik.uni-dortmund.de> (raw)
In-Reply-To: <ljfz46vnrb.fsf@troy.dt.e-technik.uni-dortmund.de> (Marius Vollmer's message of "Fri, 22 Oct 2004 16:19:36 +0200")
Marius Vollmer <marius.vollmer@uni-dortmund.de> writes:
> I have close to zero experience with using uniform vectors myself, so
> I appreciate your input.
Thanks everybody for answering!
Here is where I am heading at the moment:
- The old uniform vector implementation are gone and the SRFI-4
homogenous vectors have taken over. This means that a bunch of
precious tc7 types are freed.
This brings some non-compatible changes to the C side, which I think
are reasonable. You can no longer use SCM_UVECTOR_BASE etc and of
course the tc7 tag messing is no longer needed.
- The C API of the SRFI-4 homogenous vectors has the two functions
scm_TAGvector_elements and scm_uniform_vector_release that allow
access to the raw memory of the vector. There is scm_take_TAGvector
to have Guile take over a memory block.
- Read and print syntax for arrays has been extended to also accept
the new "u8" etc tags and Guile can now print and read arrays with
non-zero lower bounds:
(make-array 0 '(1 2) '(2 3))
=> #2@1@2((0 0) (0 0))
The "@1@2" means that the lower bounds are 1 and 2, respectively.
- The prototypes will be deprecated. Instead, make-uniform-array will
take a creator procedure; i.e, to get a u8 array you would do
(make-uniform-array make-u8vector 2 2)
=> #2u8((220 88) (48 64))
The array will not be initialized. You can use uniform-array-fill!
for that.
In place of array-prototype, which is deprecated, there is the new
array-creator.
- In addition to the types specified in SRFI-4, Guile also has c32 and
c64, which are floating point complex numbers of single and double
precision.
- vector? will be true for all zero-origin, one-dimensional arrays,
including uniform arrays except strings, bit vectors and suitable
shared arrays. Strings can be used with make-uniform-array but are
not accepted by vector? because R5RS says so. Also, vector-ref etc
will be suitably extended.
(Not implemented yet. This breaks with the tradition of RnRS to
have disjoint types. Maybe uniform vectors and general vectors
should remain disjoint? Opinions?)
- There will be some form of nice C API for uniform arrays.
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user
next prev parent reply other threads:[~2004-11-04 17:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-22 14:19 Uniform vectors, user survey Marius Vollmer
2004-10-23 14:02 ` Neil Jerram
2004-10-24 16:04 ` Mikael Djurfeldt
2004-10-25 18:08 ` Stephen Compall
2004-10-25 18:34 ` Peter Christopher
2004-10-25 19:51 ` Ludovic Courtès
2004-10-25 22:00 ` Mike Gran
2004-10-26 2:50 ` Steve Tell
2004-11-04 17:48 ` Marius Vollmer [this message]
2004-11-05 17:01 ` Marius Vollmer
-- strict thread matches above, loose matches on Subject: below --
2004-10-26 3:03 Roland Orre
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=lju0s5o689.fsf@troy.dt.e-technik.uni-dortmund.de \
--to=marius.vollmer@uni-dortmund.de \
/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).