Please implement `fxreverse-bit-field'

Bug #440155 reported by Andreas Rottmann
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ikarus Scheme
New
Undecided
Unassigned

Bug Description

Attached is a patch that adds a simple (and slow) implementation of `fxreverse-bit-field', using the algorithm from <http://graphics.stanford.edu/~seander/bithacks.html#BitReverseObvious>. Unfortunatly, my low-level Ikarus hacking skills didn't suffice to implement one of the smarter solutions from that page.

(FWIW, `fxreverse-bit-field' is used by the Huffmann coder in Göran's industria library collection).

Revision history for this message
Andreas Rottmann (rotty) wrote :
Revision history for this message
leppie (leppie) wrote :

@rotty: Dont you think UNLESS would work better than those crazy nested IF's ?

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote : Re: [Bug 440155] Re: Please implement `fxreverse-bit-field'

On Oct 2, 2009, at 7:51 PM, leppie wrote:

> @rotty: Dont you think UNLESS would work better than those crazy
> nested
> IF's ?

I think he's just following the style that's already there. It's all
my fault.

Aziz,,,

Revision history for this message
Andreas Rottmann (rotty) wrote :

leppie <email address hidden> writes:

> @rotty: Dont you think UNLESS would work better than those crazy nested
> IF's ?
>
I tried to follow the style of the existing code in the patch. I assume
Aziz had a reason to write it that way, but I don't know what that
reason would be. I agree that a version using `unless' would be more
readable.

Revision history for this message
Gwen Weinholt (weinholt) wrote :

I've written and attached an fxreverse-bit-field that does not loop if the system uses 61-bit or 30-bit fixnums. You can probably remove the loop for Ikarus (and it's not a very good loop anyway).

Revision history for this message
Marco Maggi (mrc-mgg) wrote :

Matched by Vicare issue 6, implemented using Goran's patch. Goran is it fine for you?

Revision history for this message
Gwen Weinholt (weinholt) wrote :

Marco Maggi <email address hidden> writes:

> Matched by Vicare issue 6, implemented using Goran's patch. Goran is it
> fine for you?

Sure.

--
Göran Weinholt <email address hidden>
"The gods confound the man who first found out how to distinguish the hours!
Confound him, too, who in this place set up a sundial, to cut and hack
my day so wretchedly into small pieces!" -- Titus Maccius Plautus, 200 BC

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.