Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an option to only print Constructor name without qualified module names #5776

Closed
vicuna opened this issue Oct 7, 2012 · 2 comments
Closed

Comments

@vicuna
Copy link

vicuna commented Oct 7, 2012

Original bug ID: 5776
Reporter: @bobzhang
Status: closed (set by @mshinwell on 2016-12-12T15:29:34Z)
Resolution: not a bug
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @hcarty

Bug description

for 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;;

@vicuna
Copy link
Author

vicuna commented Oct 7, 2012

Comment author: @bobzhang

If people are ok with my suggestion, I would be happy to provide a patch

@vicuna
Copy link
Author

vicuna commented Dec 12, 2016

Comment author: @mshinwell

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant