Closed c-cube closed 10 years ago
Do you mind updating the tests as well?
ocamlbuild -use-ocamlfind bencode.cma bencode.cmxa bencode.a bencode.docdir/index.html
Finished, 34 targets (0 cached) in 00:00:00.
+make test
ocamlbuild -use-ocamlfind -package oUnit lib_test/test_ounit.native
+ ocamlfind ocamlc -c -g -package oUnit -I lib_test -I lib -o lib_test/test_ounit.cmo lib_test/test_ounit.ml
File "lib_test/test_ounit.ml", line 9, characters 8-23:
Error: Unbound value BS.parse_string
Command exited with code 2.
Compilation unsuccessful after building 8 targets (0 cached) in 00:00:00.
make: *** [ounit] Error 10
Done. What do you think about the old and new interfaces?
I think it's very good. I would have preferred Decode.result
be a polymorphic variant because the constructors that it uses are very "common". For example ParseError
, StateError
, Error
could perhaps be unified. It's not a big deal though.
Also in the top level I think we should have a "toplevel" Bencode
module that we pack (maybe manually?) with the various submodules as Easy
, Streaming
, etc.
Also, I think you skipped a version number somewhere...
On 2 mai 2014 05:17:11 UTC+02:00, Rudi Grinberg notifications@github.com wrote:
I think it's very good. I would have preferred
Decode.result
be a polymorphic variant because the constructors that it uses are very "common".
It can still be done! :)
Also in the top level I think we should have a "toplevel"
Bencode
module that we pack (maybe manually?) with the various submodules asEasy
,Streaming
, etc.
Yes, I agree, it could also load a few printers (to make encoded values more readable).
Cheers!
Simon
I changed a lot of things in the way
Bencode_streaming
works, by addingBencode_token
(which deals only with "events" in the following type) and combining it with a simple stack parser that reads tokens and builds tree structures. I also added some tests and a few helper functions toBencode
itself.A new
Changelog.md
file has also been added.