Opened 5 months ago

Closed 5 months ago

#1462 closed defect (worksforme)

srfi-4 unit should support s64 and u64 vectors in Chicken 5

Reported by: johnwcowan Owned by:
Priority: major Milestone: 5.0
Component: core libraries Version: 4.13.0
Keywords: srfi-4 Cc:
Estimated difficulty: easy

Description

SRFI 4 has four sizes of integer vectors, 8-bit, 16-bit, 32-bit, and 64-bit vectors in signed and unsigned flavors. Currently, there is no support for 64-bit vectors anywhere in Chicken 4, even if the numbers egg is loaded. With native bignums, supporting s64vectors and u64vectors is straightforward and should be provided.

Change History (1)

comment:1 Changed 5 months ago by sjamaan

  • Resolution set to worksforme
  • Status changed from new to closed

I don't know what you've checked, but it seems to work just fine:

(c) 2008-2017, The CHICKEN Team
(c) 2000-2007, Felix L. Winkelmann
Version 5.0.0 (rev dfc562f1)
linux-unix-gnu-x86-64 [ 64bit dload ptables ]

#;1> (import srfi-4)
; loading /home/peter/chickens/chicken-5/lib/chicken/9/srfi-4.import.so ...
; loading /home/peter/chickens/chicken-5/lib/chicken/9/chicken.import.so ...
; loading /home/peter/chickens/chicken-5/lib/chicken/9/chicken.bitwise.import.so ...
; loading /home/peter/chickens/chicken-5/lib/chicken/9/chicken.fixnum.import.so ...
; loading /home/peter/chickens/chicken-5/lib/chicken/9/chicken.foreign.import.so ...
; loading /home/peter/chickens/chicken-5/lib/chicken/9/chicken.gc.import.so ...
; loading /home/peter/chickens/chicken-5/lib/chicken/9/chicken.platform.import.so ...
; loading /home/peter/chickens/chicken-5/lib/chicken/9/chicken.keyword.import.so ...
; loading library srfi-4 ...
#;2> (u64vector (expt 2 64))

Error: (u64vector-set!) out of range
18446744073709551616
0
18446744073709551616

        Call history:

        <syntax>          (u64vector (expt 2 64))
        <syntax>          (expt 2 64)
        <eval>    (u64vector (expt 2 64))
        <eval>    (expt 2 64)   <--
#;2> (u64vector (- (expt 2 64) 1))
#u64(18446744073709551615)

It's even documented, too!

Note: See TracTickets for help on using tickets.