From: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
To: Mark H Weaver <mhw@netris.org>
Cc: 32644@debbugs.gnu.org
Subject: bug#32644: bytevector bug
Date: Fri, 14 Sep 2018 20:44:35 +0200 [thread overview]
Message-ID: <CAGua6m2umbPrT+E5+gL-zvrdRzjJ5E9iPEcN4F7eVh3Hq3s=LQ@mail.gmail.com> (raw)
In-Reply-To: <87a7ousfio.fsf@netris.org>
[-- Attachment #1: Type: text/plain, Size: 1364 bytes --]
I managed to get it to compile on the latest lightning branch as of
2018-09-14
On Thu, Sep 6, 2018 at 7:28 PM Mark H Weaver <mhw@netris.org> wrote:
> Stefan Israelsson Tampe <stefan.itampe@gmail.com> writes:
>
> > The code velow does not compile when the define-inlinable of id is
> active. If in stead
> > id defined by define is used it all compiles just fine.
> >
> > Tested on latest tar ball for guile 2.4
>
> Did you mean to write guile 2.2.4?
>
> Mark
>
>
> > -------------------------------------------
> > (use-modules (rnrs bytevectors))
> >
> > (define-inlinable (id x) x)
> > ;(define (id x) x)
> > (define-syntax-rule (mkcrc crc_hqx high xor mask)
> > (define (crc_hqx data value)
> > (let ((n (bytevector-length data))
> > (d data))
> > (let lp ((i 0) (v value))
> > (if (< i n)
> > (let ((b (id (bytevector-u8-ref d i))))
> > (let lp2 ((j 0) (x 1) (v v))
> > (if (> j -8)
> > (let ((bit (ash (logand x b) j))
> > (hbit (logand v high)))
> > (if (= hbit 0)
> > (lp2 (- j 1) (ash x 1) (logior bit (ash v 1)))
> > (lp2 (- j 1) (ash x 1) (logxor
> > xor
> > (logand mask
> > (logior
> > bit
> > (ash v 1)))))))
> > (lp (+ i 1) v))))
> > v)))))
> >
> > (mkcrc crc_hqx #x8000 #x1021 #xffff)
> > (mkcrc crc32 #x80000000 #x04c11db7 #xffffffff)
>
[-- Attachment #2: Type: text/html, Size: 1965 bytes --]
next prev parent reply other threads:[~2018-09-14 18:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-05 17:53 bug#32644: bytevector bug Stefan Israelsson Tampe
2018-09-06 17:27 ` Mark H Weaver
2018-09-14 18:44 ` Stefan Israelsson Tampe [this message]
2018-10-14 7:38 ` Mark H Weaver
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='CAGua6m2umbPrT+E5+gL-zvrdRzjJ5E9iPEcN4F7eVh3Hq3s=LQ@mail.gmail.com' \
--to=stefan.itampe@gmail.com \
--cc=32644@debbugs.gnu.org \
--cc=mhw@netris.org \
/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).