Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006113OCamlOCaml generalpublic2013-08-01 08:372015-12-25 19:55
Reporterberenger 
Assigned Togasche 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version4.03.0+dev 
Summary0006113: listing the available toplevel directives with #help
DescriptionHello,

It would be nice if there was a way to list
all the directives the toplevel understands
(plus a short description for each, at least).

Thanks,
F.
Tagsjunior_job, patch
Attached Filespatch file icon print_directives.patch [^] (9,039 bytes) 2013-08-04 21:36 [Show Content]
patch file icon toplevel-help.patch [^] (1,148 bytes) 2014-04-27 16:49 [Show Content]

- Relationships
has duplicate 0006891resolvedgasche #help directive (at the REPL) 

-  Notes
(0010094)
gian (reporter)
2013-08-04 21:40

I've made a patch for this.
- Printing on large descriptions looks bad in my opinion, so I made small descriptions based on the ones on Caml's manual. Perhaps someone more knowledgeable can provide better descriptions.
- In order to maintain compatibility with other programs that add directives to the compiler I had to make a second hashtable with the names as key and the descriptions as value. To avoid such problems in the future I added a new function that handles new entries to the hashtable. Perhaps the new hashtable can be changed to hold a list of strings as information instead of just the description.
- #help will print all directives (including directives that have been added by other libraries) along with their description if it exists. It will only look for directives on the original hashtable (so directives from other libraries) if the size of the hashtables don't match.
(0011330)
berke.durak (reporter)
2014-04-27 16:51
edited on: 2014-04-27 17:00

Here's a shorter, less intrusive version that doesn't have descriptions but prints the directive argument types.

This is a stop-gap solution, esp. since module X = Foo won't print the signature anymore. I agree that descriptions would be better.

(0014025)
gasche (developer)
2015-06-05 16:45

This feature was just requested again. I only had a very quick look, but it personally seems to me that gian's patch is reasonable in terms of invasiveness -- and I think having short descriptions is important. Integrating the "expected arguments" information of Berke's patch on top of it would be very nice.
(0015192)
fdsouthern (reporter)
2015-12-25 16:11

I've tried to combine the patches given above, as well as extend it to the new(?) directives that weren't covered. I've submitted a pull request on Github. Please let me know if there's anything I should have done differently.
(0015193)
gasche (developer)
2015-12-25 17:12

There is an unfortunate duplication of work between
  https://github.com/ocaml/ocaml/pull/46 [^]
and
  https://github.com/ocaml/ocaml/pull/376 [^]
probably due to a lack of communication of my part.

The easiest way to solve the problem is to merge the feature and close the bug. I'll merge both patchesets and commit them.

- Issue History
Date Modified Username Field Change
2013-08-01 08:37 berenger New Issue
2013-08-01 08:55 gasche Tag Attached: junior_job
2013-08-01 11:33 xleroy Status new => acknowledged
2013-08-04 21:36 gian File Added: print_directives.patch
2013-08-04 21:40 gian Note Added: 0010094
2013-09-18 16:34 lpw25 Tag Attached: patch
2014-04-27 16:49 berke.durak File Added: toplevel-help.patch
2014-04-27 16:51 berke.durak Note Added: 0011330
2014-04-27 17:00 berke.durak Note Edited: 0011330 View Revisions
2015-06-05 16:44 gasche Relationship added has duplicate 0006891
2015-06-05 16:45 gasche Note Added: 0014025
2015-12-25 16:11 fdsouthern Note Added: 0015192
2015-12-25 17:12 gasche Note Added: 0015193
2015-12-25 19:55 gasche Status acknowledged => resolved
2015-12-25 19:55 gasche Fixed in Version => 4.03.0+dev
2015-12-25 19:55 gasche Resolution open => fixed
2015-12-25 19:55 gasche Assigned To => gasche


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker