From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marius Vollmer Newsgroups: gmane.lisp.guile.user Subject: Re: SRFI-4 in Guile 1.7 Date: Wed, 23 Mar 2005 12:21:52 +0100 Message-ID: <87eke61ub3.fsf@zagadka.de> References: <87vf7ivflw.fsf@laas.fr> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1111578157 3057 80.91.229.2 (23 Mar 2005 11:42:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 23 Mar 2005 11:42:37 +0000 (UTC) Cc: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Mar 23 12:42:36 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DE4Fc-0006xE-6R for guile-user@m.gmane.org; Wed, 23 Mar 2005 12:42:16 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DE4X5-0001J0-T4 for guile-user@m.gmane.org; Wed, 23 Mar 2005 07:00:20 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DE4KN-0005Mo-Et for guile-user@gnu.org; Wed, 23 Mar 2005 06:47:12 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DE4KF-0005HA-Om for guile-user@gnu.org; Wed, 23 Mar 2005 06:47:06 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DE4KE-0005Ae-CR for guile-user@gnu.org; Wed, 23 Mar 2005 06:47:02 -0500 Original-Received: from [195.253.8.218] (helo=mail.dokom.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DE3vw-00017c-FP for guile-user@gnu.org; Wed, 23 Mar 2005 06:21:56 -0500 Original-Received: from [195.253.19.208] (helo=zagadka.ping.de) by mail.dokom.net with smtp (Exim 4.34) id 1DE3vu-000645-3T for guile-user@gnu.org; Wed, 23 Mar 2005 12:21:54 +0100 Original-Received: (qmail 13419 invoked by uid 1000); 23 Mar 2005 11:21:52 -0000 Original-To: ludovic.courtes@laas.fr (=?iso-8859-1?q?Ludovic_Court=E8s?=) In-Reply-To: <87vf7ivflw.fsf@laas.fr> ( =?iso-8859-1?q?Ludovic_Court=E8s's_message_of?= "Wed, 23 Mar 2005 11:08:59 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org X-MailScanner-To: guile-user@m.gmane.org Xref: news.gmane.org gmane.lisp.guile.user:4307 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:4307 ludovic.courtes@laas.fr (Ludovic Courtès) writes: > Can one expect the increment returned by `scm_TAGvector_elements ()' to > always be 1 when TAG is `u8', 2 when TAG is `u16', and so on? No, you can't. The increment gives the number of _elements_ between the real elements of the vector in memory, not the number of _bytes_. Very nearly all vectors will have an increment of 1, but not all. See "Shared Arrays" in the manual: shared arrays of rank one are vectors, but they don't need to be stored contiguously in memory. For example, the diagonal of a 3x3 matrix is a vector, and to go from one element of this vector to the next, you need to skip 4 elements in memory (one full row of the matrix plus one more). Such a vector has an increment of 4. The size of an element in a uniform numeric vector can be retrieved with scm_array_handle_uniform_element_size, if you need it. > I have this impression, although I couldn't find proofs in the > source code. Maybe we could improve the manual. Do you have a suggestion? -- GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405 _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user