Fixes to bitvector-unfold implementation Wolfgang Corcoran-Mathe (20 Mar 2023 18:57 UTC)
Re: Fixes to bitvector-unfold implementation Arthur A. Gleckler (20 Mar 2023 22:35 UTC)

Fixes to bitvector-unfold implementation Wolfgang Corcoran-Mathe 20 Mar 2023 18:57 UTC

Hi,

I’ve rewritten the sample implementations of bitvector-unfold and of
-unfold-right. As Marc pointed out to me, the simple approach to these
procedures allows still-to-be-mutated results to leak out if multiple
returns occur. The new versions simply unfold a list and then convert
it with list->bitvector.

Unfortunately, the SRFI doesn’t require this referential transparency.
As with R7RS vector-map, results of earlier returns shouldn’t be
mutated. bitvector-map and friends are unaffected in this implementation,
but I think SRFI 133 might need some attention.

Regards, Wolf

Pull request: https://github.com/scheme-requests-for-implementation/srfi-178/pull/15

--
Wolfgang Corcoran-Mathe  <xxxxxx@sigwinch.xyz>