From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Frank Terbeck Newsgroups: gmane.lisp.guile.user Subject: SRFI-151 (Bitwise Operations) Implementation Date: Thu, 09 Jan 2020 05:28:41 +0100 Message-ID: <87y2uh2qyu.fsf@ft.bewatermyfriend.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="83229"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Jan 09 05:33:11 2020 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ipPS2-000nrO-1e for guile-user@m.gmane.org; Thu, 09 Jan 2020 05:29:42 +0100 Original-Received: from localhost ([::1]:55184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipPS0-0006y0-Lg for guile-user@m.gmane.org; Wed, 08 Jan 2020 23:29:40 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59018) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipPRC-0006Xu-PV for guile-user@gnu.org; Wed, 08 Jan 2020 23:28:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipPRB-0004w9-E0 for guile-user@gnu.org; Wed, 08 Jan 2020 23:28:50 -0500 Original-Received: from smtprelay08.ispgateway.de ([134.119.228.106]:5862) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ipPRB-0004p0-6P for guile-user@gnu.org; Wed, 08 Jan 2020 23:28:49 -0500 Original-Received: from [62.155.196.179] (helo=jim.voodoo.lan) by smtprelay08.ispgateway.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1ipPR6-0004wj-H9 for guile-user@gnu.org; Thu, 09 Jan 2020 05:28:44 +0100 Original-Received: by jim.voodoo.lan (Postfix, from userid 1000) id 08B0C127781; Thu, 9 Jan 2020 05:28:42 +0100 (CET) X-Df-Sender: NDMwNDQ0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 134.119.228.106 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:16013 Archived-At: 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 =E2=80=9CIntegers as Bits=E2=80= =9D) and other functions from Guile's core. SRFI-151 has one API that returns a SRFI-121 generator=C2=B9 to traverse = an integer. Since Guile currently doesn't have a SRFI-121 implementation=C2= =B2, this function=C2=B3 is missing from this implementation. The implementation can be found here: https://gitlab.com/ft/srfi-151 The test-suite reproduces the examples from the specification, plus a couple of additional ones. Maybe this is useful for someone. Regards, Frank =C2=B9 http://srfi.schemers.org/srfi-121/srfi-121.html =C2=B2 https://www.mail-archive.com/guile-devel@gnu.org/msg14950.html =C2=B3 make-bitwise-generator --=20 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