[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SRFI-151 (Bitwise Operations) Implementation

From: Frank Terbeck
Subject: SRFI-151 (Bitwise Operations) Implementation
Date: Thu, 09 Jan 2020 05:28:41 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Hey Guilers!

Since I got  a project that uses (potentially large)  integers to encode
bits in registers,  I was looking at  SRFIs that deal with  that type of
domain. The most recent entry is SRFI-151, which is in final status.

Since Guile currently doesn't have an implementation of this SRFI, I fi-
gured I might as well add one.

I tried to reuse as many facilities  that are already in Guile to get to
a complete implementation. So it reuses  stuff from the R6RS bitwise li-
brary, as well as SRFI-60 (which is titled “Integers as Bits”) and other
functions from Guile's core.

SRFI-151 has one  API that returns a SRFI-121 generator¹  to traverse an
integer. Since Guile currently  doesn't have a SRFI-121 implementation²,
this function³ is missing from this implementation.

The implementation can be found here:

The test-suite  reproduces the examples  from the specification,  plus a
couple of additional ones.  Maybe this is useful for someone.

Regards, Frank

³ make-bitwise-generator

In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925

reply via email to

[Prev in Thread] Current Thread [Next in Thread]