GNU bug report logs - #18224
Shared arrays are incompatible with bytevector accessors

Previous Next

Package: guile;

Reported by: Panicz Maciej Godek <godek.maciek <at> gmail.com>

Date: Fri, 8 Aug 2014 14:49:01 UTC

Severity: normal

Done: Daniel Llorens <daniel.llorens <at> bluewin.ch>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Panicz Maciej Godek <godek.maciek <at> gmail.com>
To: bug-guile <at> gnu.org
Subject: Shared arrays are incompatible with bytevector accessors
Date: Fri, 8 Aug 2014 16:48:08 +0200
Creating a shared array based on a bytevector results with an object
whose print representation is identical with a print-representation of
a bytevector:

(define bv #vu8(0 1 2 3))

(define bv/shared
  (make-shared-array bv (lambda(i)(list (+ i 2))) '(0 1)))
bv/shared
====> #vu8(2 3)

However, accessing these "shared bytevectors" using the bytevector api
is impossible:

(bytevector-u8-ref bv/shared 0)
====> error: wrong type argument in position 1 (expecting bytevector): #vu8(2 3)

Since the print-representation is identical, this behaviour is
unexpected. Furthermore, the lack of capability of creating shared
bytevectors limits their usefullness. On the other hand, if the shared
bytevector remains contiguous, there should be no performance
concerns.




This bug report was last modified 9 years and 202 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.