Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006051OCamlOCaml documentationpublic2013-06-24 11:052014-07-22 23:38
Reporterdbuenzli 
Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version4.00.1 
Target Version4.02.0+devFixed in Version4.02.0+dev 
Summary0006051: Document which Sys function raise Sys_error
DescriptionThere are quite a few functions in Sys that may raise Sys_error (e.g. Sys.remove). It would be nice to document that in the mli.
Tagsjunior_job
Attached Files

- Relationships

-  Notes
(0009610)
gasche (developer)
2013-06-24 13:25

If someone out there is interested in contributing, this issue should be relatively easy to fix. Directly looking at stdlib/sys.ml won't tell you much, because most of the functions are implemented as external C stubs; one should look instead at the use of the C functions raising this exception (through "caml_sys_error", "caml_raise_sys_error" or "caml_sys_io_error"). The following regexp gives all call sites for any of these functions:

  find . -name '*.c' | xargs grep -e "caml\\w*sys\\w*error" -A 10 -B 10 --color=always | less -R

It is then a matter of knowing where the C stubs using these functions are themselves called from the OCaml side, and annotating the .mli documentation accordingly -- as is already done for the functions in pervasives.mli.
(0009616)
xleroy (administrator)
2013-06-25 13:06

To a first approximation, all Sys functions can raise Sys_error or might raise it in the future. A blanket statement at the beginning of the Sys module might be better than a per-function description.
(0009768)
doligez (administrator)
2013-07-12 17:10

I vote for the blanket statement.
(0011900)
doligez (administrator)
2014-07-22 23:38

Documented in 4.02 (commit 15020).

- Issue History
Date Modified Username Field Change
2013-06-24 11:05 dbuenzli New Issue
2013-06-24 13:25 gasche Note Added: 0009610
2013-06-24 13:25 gasche Status new => acknowledged
2013-06-25 13:06 xleroy Note Added: 0009616
2013-07-12 17:10 doligez Note Added: 0009768
2013-07-12 17:10 doligez Target Version => 4.01.0+dev
2013-08-19 16:32 doligez Tag Attached: junior_job
2013-08-19 16:50 doligez Target Version 4.01.0+dev => 4.01.1+dev
2014-05-25 20:20 doligez Target Version 4.01.1+dev => 4.02.0+dev
2014-07-22 23:38 doligez Note Added: 0011900
2014-07-22 23:38 doligez Status acknowledged => closed
2014-07-22 23:38 doligez Resolution open => fixed
2014-07-22 23:38 doligez Fixed in Version => 4.02.0+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker