unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: "Ryan Moore" <moorerw@westminster.edu>
Subject: make-shared-array and bitvectors
Date: Wed, 01 Nov 2006 16:45:31 -0500	[thread overview]
Message-ID: <4548CF2B020000FC0000425F@WC-MESSAGE.westminster.edu> (raw)

Making a shared array out of a bit vector does not result in a bit
vector being returned when the shared array does not have as many
elements as the original:

(define somebits (make-bitvector 8 #f))
(define subbits (make-shared-array somebits (lambda (dim) (list dim))
4))
(define allsubbits (make-shared-array somebits (lambda (dim) (list dim))
8))

(bitvector? somebits) => #t
(bitvector? subbits) => #f
(bitvector? allsubbits) => #t

(display somebits) =>#*00000000
(display subbits) => #b(#f #f #f #f)
(display allsubbits) => #*00000000

The 1.8 manual states: "Bit vectors are are also generalized vectors,
See Generalized Vectors, and can thus be used with the array procedures,
See Arrays" but as we can see, array procedures do not work as expected
on bitvectors.  If this is expected behavior, I feel it should be
clarified. I would think that making a shared array out of a bitvector
would result in a bitvector after all...


Thanks,
Ryan Moore



_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile


             reply	other threads:[~2006-11-01 21:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-01 21:45 Ryan Moore [this message]
2006-11-17 14:58 ` make-shared-array and bitvectors Neil Jerram

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=4548CF2B020000FC0000425F@WC-MESSAGE.westminster.edu \
    --to=moorerw@westminster.edu \
    /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).