[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#432590: libcf-ocaml: The function nearest_incr in functer Cf_rbtree.Map doesn't work.



Package: libcf-ocaml
Version: 0.8-1
Severity: normal

Hi!

nearest_incr in Cf_rbtree.Map produces wrong results. Here is a sample
script:

############################################################
module Oint = struct type t = int  let compare = compare end (*Normal ordering for red-black-tree*)
module Rbtree = Cf_rbtree.Map (Oint)
open Rbtree

let tree = of_list (List.map (fun a -> (a,())) [9;1;8;3;7;5;4])

let l = Cf_seq.to_list (nearest_incr 5 tree)

let p (i,()) = print_int i; print_newline()

let () =
  List.iter p l
############################################################

The output looks like this:

1
3
4
5
7
8
9

But it should be 5 7 8 9.

Maybe I will have some time to look into this in some weeks...

Christopher

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (50, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.18-4-amd64 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libcf-ocaml depends on:
ii  libc6                         2.5-9      GNU C Library: Shared libraries
ii  ocaml-base-nox [ocaml-base-no 3.09.2-9   Runtime system for ocaml bytecode 

libcf-ocaml recommends no packages.

-- no debconf information



Reply to: