Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007751OCamltoplevelpublic2018-03-12 10:062018-03-13 04:36
Assigned Togarrigue 
PlatformOSOS Version
Product Version4.06.1 
Target VersionFixed in Version 
Summary0007751: occasionally unhelpful behavior of toplevel when printing values
DescriptionIf I do this on the Ocaml toplevel:

  #use "topfind";;
  #require "compiler-libs.common";;
  Parse.implementation (Lexing.from_string "foo");;

what I see is this:

  - : Parsetree.structure =
  [{Parsetree.pstr_desc =
      ({Parsetree.pexp_desc = Parsetree.Pexp_ident <abstr>; pexp_loc = <abstr>;
        pexp_attributes = []},
    pstr_loc = <abstr>}]

The problem (in my opinion) is that some of the values are printed as


even if they are not abstract and the corresponding *.cmi files (which describes their structure) is available. For some reason, Ocaml toplevel chooses not to process them.

I find this behavior surprising (at least).
It certainly also is an undocumented behavior.

Related surprising behavior is that when I install printers for those values that are printed as "<abstr>", those printers will not be used
(just because that Ocaml toplevel chooses (for an unknown reason) not to process relevant *.cmi files.

Interestingly, if I make some dummy calls of functions in some of the modules that Ocaml toplevel (temporarily) avoided to process, it processes them lazily and then the printing procedures behave in an expected manner.
Steps To ReproduceIn Ocaml toplevel:

  #use "topfind";;
  #require "compiler-libs.common";;
  Parse.implementation (Lexing.from_string "foo");;
Additional Information [^]
TagsNo tags attached.
Attached Files

- Relationships
related to 0007134assignedgarrigue compiler forcing aliases it shouldn't while reporting type errors 

-  Notes
kosik (reporter)
2018-03-12 10:08

Sorry, the title should read:

  "occasionally unhelpful behavior of *Ocaml toplevel* when printing values
garrigue (manager)
2018-03-13 03:37

I observe the same behavior with

$ ocaml -I +compiler-libs ocamlcommon.cma
# Parse.implementation (Lexing.from_string "foo");;
garrigue (manager)
2018-03-13 04:36

Apparently the culprit is the fix of MPR#7134, which blocked the loading of cmis.
A tentative fix is at: [^]

- Issue History
Date Modified Username Field Change
2018-03-12 10:06 kosik New Issue
2018-03-12 10:08 kosik Note Added: 0018941
2018-03-12 10:23 trefis Summary occasionally unhelpful behavior of coqtop when printing values => occasionally unhelpful behavior of toplevel when printing values
2018-03-13 03:37 garrigue Note Added: 0018943
2018-03-13 03:37 garrigue Assigned To => garrigue
2018-03-13 03:37 garrigue Status new => confirmed
2018-03-13 03:37 garrigue Relationship added related to 0007134
2018-03-13 04:36 garrigue Note Added: 0018944

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker