Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005776OCaml-OCaml generalpublic2012-10-07 02:502016-12-12 16:29
Reporterhongboz 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityhave not tried
StatusclosedResolutionno change required 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0005776: Provide an option to only print Constructor name without qualified module names
Descriptionfor example, when I have a nested Ast as follows,
most information was hidden by the qualified module paths
MetaAst.Expr.meta_patt _loc v |> anti_obj#expr; ;
- : Lib.Expr.Ast.expr =
Lib.Expr.Ast.ExApp (,
 Lib.Expr.Ast.ExApp (,
  Lib.Expr.Ast.ExApp (,
   Lib.Expr.Ast.ExId (,
    Lib.Expr.Ast.IdAcc (, Lib.Expr.Ast.IdUid (, "Ast"),
     Lib.Expr.Ast.IdUid (, "PaApp"))),
   Lib.Expr.Ast.ExId (, Lib.Expr.Ast.IdLid (, "_loc"))),
  Lib.Expr.Ast.ExApp (,
   Lib.Expr.Ast.ExApp (,
    Lib.Expr.Ast.ExId (,
     Lib.Expr.Ast.IdAcc (, Lib.Expr.Ast.IdUid (, "Ast"),
      Lib.Expr.Ast.IdUid (, "PaId"))),
    Lib.Expr.Ast.ExId (, Lib.Expr.Ast.IdLid (, "_loc"))),
   Lib.Expr.Ast.ExApp (,
    Lib.Expr.Ast.ExApp (,
     Lib.Expr.Ast.ExId (,
      Lib.Expr.Ast.IdAcc (, Lib.Expr.Ast.IdUid (, "Ast"),
       Lib.Expr.Ast.IdUid (, "IdUid"))),
     Lib.Expr.Ast.ExId (, Lib.Expr.Ast.IdLid (, "_loc"))),
    Lib.Expr.Ast.ExStr (, "A")))),
 Lib.Expr.Ast.ExId (, Lib.Expr.Ast.IdLid (, "x")))
It would be great for the toplevel to have an option to get output as follows:
ExApp (,
 ExApp (,
  ExApp (, ExId (, IdAcc (, IdUid (, "Ast"), IdUid (, "PaApp"))),
   ExId (, IdLid (, "_loc"))),
  ExApp (,
   ExApp (, ExId (, IdAcc (, IdUid (, "Ast"), IdUid (, "PaId"))),
    ExId (, IdLid (, "_loc"))),
   ExApp (,
    ExApp (, ExId (, IdAcc (, IdUid (, "Ast"), IdUid (, "IdUid"))),
     ExId (, IdLid (, "_loc"))),
    ExStr (, "A")))),
 ExId (, IdLid (, "x")))

suppose we have two directives like this
#print_qualified;;
#unprint_qualified;;
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0008214)
hongboz (developer)
2012-10-07 03:12

If people are ok with my suggestion, I would be happy to provide a patch
(0016966)
shinwell (developer)
2016-12-12 16:29

@lpw25 suggests that applying short-paths to constructors might solve this problem. Please submit a patch to Github if you want to pursue this issue.

- Issue History
Date Modified Username Field Change
2012-10-07 02:50 hongboz New Issue
2012-10-07 03:12 hongboz Note Added: 0008214
2013-06-28 17:27 doligez Status new => acknowledged
2016-12-12 16:29 shinwell Note Added: 0016966
2016-12-12 16:29 shinwell Status acknowledged => closed
2016-12-12 16:29 shinwell Resolution open => no change required
2017-02-23 16:36 doligez Category OCaml general => -OCaml general


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker