(srfi : 43 vectors) - vector-reverse-copy! incorrect when source=target and tstart=sstart

Bug #595513 reported by Peter Lane
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Scheme Libraries
Fix Committed
High
Unassigned

Bug Description

Small inconsistency with SRFI document:

> (import (srfi :43))
> (define b (vector 1 2 3 4))
> (vector-reverse-copy! b 0 b 0)
> b
#(4 3 3 4)

SRFI documentation says start=target & tstart=sstart means behaviour should be same as vector-reverse!

racket and sisc return #(4 3 2 1) for above example.

Suggest fix in 'vector-lib.scm'

add "((and (eq? target source) (= sstart tstart)) (vector-reverse! target tstart send))"
as first clause of 'cond' in 'vector-reverse-copy!'

Changed in scheme-libraries:
importance: Undecided → High
assignee: nobody → Derick Eddington (derick-eddington)
Changed in scheme-libraries:
assignee: Derick Eddington (derick-eddington) → nobody
Changed in scheme-libraries:
status: New → Fix Committed
description: updated
Revision history for this message
Gwen Weinholt (weinholt) wrote :

FWIW, this SRFI collection still lives, here: https://github.com/arcfide/chez-srfi

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.