From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: doc srfi-4 Date: Wed, 11 Feb 2004 08:49:53 +1000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <8765eeft2m.fsf@zip.com.au> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1076454901 12586 80.91.224.253 (10 Feb 2004 23:15:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 10 Feb 2004 23:15:01 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Feb 11 00:14:51 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 1Aqh5e-0007ah-00 for ; Wed, 11 Feb 2004 00:14:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Aqh4g-0003P0-V3 for guile-devel@m.gmane.org; Tue, 10 Feb 2004 18:13:50 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AqgjO-0004zw-Is for guile-devel@gnu.org; Tue, 10 Feb 2004 17:51:50 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Aqghv-0004CI-Sv for guile-devel@gnu.org; Tue, 10 Feb 2004 17:50:51 -0500 Original-Received: from [61.8.0.85] (helo=mailout2.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Aqghe-0003uN-1R for guile-devel@gnu.org; Tue, 10 Feb 2004 17:50:02 -0500 Original-Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86]) by mailout2.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1AMnx5O022876 for ; Wed, 11 Feb 2004 09:49:59 +1100 Original-Received: from localhost (ppp70.dyn248.pacific.net.au [203.143.248.70]) by mailproxy1.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1AMnvi0026375 for ; Wed, 11 Feb 2004 09:49:58 +1100 Original-Received: from gg by localhost with local (Exim 3.36 #1 (Debian)) id 1AqghV-0001Tz-00; Wed, 11 Feb 2004 08:49:53 +1000 Original-To: guile-devel@gnu.org Mail-Copies-To: never User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:3358 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3358 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