unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* doc srfi-4
@ 2004-02-10 22:49 Kevin Ryde
  2004-03-20 22:31 ` Marius Vollmer
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Ryde @ 2004-02-10 22:49 UTC (permalink / raw)


I think the srfi-4 docs would be clearer with each available function
named explicitly.  I know it's a bit repetitive, but seeing TAGvector?
etc means you have to look for what TAG means, and also means emacs
info-look won't work.

I also think the separate sections for read syntax and the procedures
can be combined, the whole is still pretty short.




SRFI-4 - Homogeneous numeric vector datatypes
=============================================

SRFI-4 defines a set of datatypes and functions for vectors whose
elements are numbers, all of the same numeric type.  Vectors for signed
and unsigned exact integers and inexact reals in several precisions are
available.  Being homogeneous means they require less memory than
normal vectors.

   The functions and the read syntax in this section are made available
with

     (use-modules (srfi srfi-4))

   Procedures similar to the vector procedures (*note Vectors::) are
provided for handling these homogeneous vectors, but they are distinct
datatypes and the two cannot be inter-mixed.

   Ten vector data types are provided: Unsigned and signed integer
values with 8, 16, 32 and 64 bits and floating point values with 32 and
64 bits.  The type is indicated by a tag in the function names, `u8',
`s8', `u16', `s16', `u32', `s32', `u64', `s64', `f32', `f64'.

   The external representation (ie. read syntax) for these vectors is
similar to normal Scheme vectors, but with an additional tag
indiciating the vector's type.  For example,

     #u16(1 2 3)
     #f64(3.1415 2.71)

   Note that the read syntax for floating-point here conflicts with
`#f' for false.  In Standard Scheme one can write `(1 #f3)' for a three
element list `(1 #f 3)', but with the SRFI-4 module `(1 #f3)' is
invalid.  `(1 #f 3)' is almost certainly what one should write anyway
to make the intention clear, so this is rarely a problem.


 - Scheme Procedure: u8vector? obj
 - Scheme Procedure: s8vector? obj
 - Scheme Procedure: u16vector? obj
 - Scheme Procedure: s16vector? obj
 - Scheme Procedure: u32vector? obj
 - Scheme Procedure: s32vector? obj
 - Scheme Procedure: u64vector? obj
 - Scheme Procedure: s64vector? obj
 - Scheme Procedure: f32vector? obj
 - Scheme Procedure: f64vector? obj
     Return `#t' if OBJ is a homogeneous numeric vector of the
     indicated type.

 - Scheme Procedure: make-u8vector n [value]
 - Scheme Procedure: make-s8vector n [value]
 - Scheme Procedure: make-u16vector n [value]
 - Scheme Procedure: make-s16vector n [value]
 - Scheme Procedure: make-u32vector n [value]
 - Scheme Procedure: make-s32vector n [value]
 - Scheme Procedure: make-u64vector n [value]
 - Scheme Procedure: make-s64vector n [value]
 - Scheme Procedure: make-f32vector n [value]
 - Scheme Procedure: make-f64vector n [value]
     Return a newly allocated homogeneous numeric vector holding N
     elements of the indicated type.  If VALUE is given, the vector is
     initialized with that value, otherwise the contents are
     unspecified.

 - Scheme Procedure: u8vector value ...
 - Scheme Procedure: s8vector value ...
 - Scheme Procedure: u16vector value ...
 - Scheme Procedure: s16vector value ...
 - Scheme Procedure: u32vector value ...
 - Scheme Procedure: s32vector value ...
 - Scheme Procedure: u64vector value ...
 - Scheme Procedure: s64vector value ...
 - Scheme Procedure: f32vector value ...
 - Scheme Procedure: f64vector value ...
     Return a newly allocated homogeneous numeric vector of the
     indicated type, holding the given parameter VALUEs.  The vector
     length is the number of parameters given.

 - Scheme Procedure: u8vector-length vec
 - Scheme Procedure: s8vector-length vec
 - Scheme Procedure: u16vector-length vec
 - Scheme Procedure: s16vector-length vec
 - Scheme Procedure: u32vector-length vec
 - Scheme Procedure: s32vector-length vec
 - Scheme Procedure: u64vector-length vec
 - Scheme Procedure: s64vector-length vec
 - Scheme Procedure: f32vector-length vec
 - Scheme Procedure: f64vector-length vec
     Return the number of elements in VEC.

 - Scheme Procedure: u8vector-ref vec i
 - Scheme Procedure: s8vector-ref vec i
 - Scheme Procedure: u16vector-ref vec i
 - Scheme Procedure: s16vector-ref vec i
 - Scheme Procedure: u32vector-ref vec i
 - Scheme Procedure: s32vector-ref vec i
 - Scheme Procedure: u64vector-ref vec i
 - Scheme Procedure: s64vector-ref vec i
 - Scheme Procedure: f32vector-ref vec i
 - Scheme Procedure: f64vector-ref vec i
     Return the element at index I in VEC.  The first element in VEC is
     index 0.

 - Scheme Procedure: u8vector-ref vec i value
 - Scheme Procedure: s8vector-ref vec i value
 - Scheme Procedure: u16vector-ref vec i value
 - Scheme Procedure: s16vector-ref vec i value
 - Scheme Procedure: u32vector-ref vec i value
 - Scheme Procedure: s32vector-ref vec i value
 - Scheme Procedure: u64vector-ref vec i value
 - Scheme Procedure: s64vector-ref vec i value
 - Scheme Procedure: f32vector-ref vec i value
 - Scheme Procedure: f64vector-ref vec i value
     Set the element at index I in VEC to VALUE.  The first element in
     VEC is index 0.  The return value is unspecified.

 - Scheme Procedure: u8vector->list vec
 - Scheme Procedure: s8vector->list vec
 - Scheme Procedure: u16vector->list vec
 - Scheme Procedure: s16vector->list vec
 - Scheme Procedure: u32vector->list vec
 - Scheme Procedure: s32vector->list vec
 - Scheme Procedure: u64vector->list vec
 - Scheme Procedure: s64vector->list vec
 - Scheme Procedure: f32vector->list vec
 - Scheme Procedure: f64vector->list vec
     Return a newly allocated list holding all elements of VEC.

 - Scheme Procedure: list->u8vector lst
 - Scheme Procedure: list->s8vector lst
 - Scheme Procedure: list->u16vector lst
 - Scheme Procedure: list->s16vector lst
 - Scheme Procedure: list->u32vector lst
 - Scheme Procedure: list->s32vector lst
 - Scheme Procedure: list->u64vector lst
 - Scheme Procedure: list->s64vector lst
 - Scheme Procedure: list->f32vector lst
 - Scheme Procedure: list->f64vector lst
     Return a newly allocated homogeneous numeric vector of the
     indicated type, initialized with the elements of the list LST.


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: doc srfi-4
  2004-02-10 22:49 doc srfi-4 Kevin Ryde
@ 2004-03-20 22:31 ` Marius Vollmer
  0 siblings, 0 replies; 2+ messages in thread
From: Marius Vollmer @ 2004-03-20 22:31 UTC (permalink / raw)


Kevin Ryde <user42@zip.com.au> writes:

> I think the srfi-4 docs would be clearer with each available function
> named explicitly.  I know it's a bit repetitive, but seeing TAGvector?
> etc means you have to look for what TAG means, and also means emacs
> info-look won't work.
>
> I also think the separate sections for read syntax and the procedures
> can be combined, the whole is still pretty short.

Agreed!  Thanks!

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-03-20 22:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-10 22:49 doc srfi-4 Kevin Ryde
2004-03-20 22:31 ` Marius Vollmer

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).