Skip to content

MPR#7551: manual, make final ";;" potentially optional in caml_example#1194

Merged
gasche merged 3 commits intoocaml:trunkfrom
Octachron:tune_caml_example
Jun 7, 2017
Merged

MPR#7551: manual, make final ";;" potentially optional in caml_example#1194
gasche merged 3 commits intoocaml:trunkfrom
Octachron:tune_caml_example

Conversation

@Octachron
Copy link
Copy Markdown
Member

MPR#7551:
This PR makes it possible to omit the final ;; in a caml_example environment.
By default, this final ;; is still mandatory and a new command line option -implicit-stop makes it optional globally.

This global setting can be overrided locally by adding an optional argument to the environment:

  • [toplevel] makes the final ;; mandatory
  • [verbatim] makes it optional

This new optional argument must precedes the expected status argument:

\begin{caml_example*}[verbatim][error]
1 + 2.
\end{caml_example}

The tutorial part of the manual is configured to use the globally mandatory ;; mode for the sake of consistency whereas the language extension section uses the new optional ;; mode.

This commit makes it possible to omit the final ";;" in a caml_example
environment.

By default, this final ";;" is still mandatory. A new command line
option "-implicit-stop" makes it optional globally.

This global setting can be overrided locally by adding an optional
argument to the environment:

* [toplevel] makes the ";;" mandatory
* [verbatim] makes it optional

The tutorial part of the manual is configured to use the mandatory ";;"
mode globally for the sake of consistency whereas the language extension
section uses the new optional ";;" mode.
@gasche
Copy link
Copy Markdown
Member

gasche commented Jun 7, 2017

I appreciate you going the extra mile for convenience, but I don't like the idea that the same usage of the environment will have different default behaviors in different parts of the manual. We save 10 characters each time, but at the cost of auto-discoverability of behavior -- think of beginners that just jump in the .etex file and play around from what is already there. Could you disable that part and we would just use [verbatim] and [toplevel] each time? (You could fail if no such argument is provided.)

@mshinwell mshinwell changed the title MPR#7551: manual, make final ";;" potentiallt optional in caml_example MPR#7551: manual, make final ";;" potentially optional in caml_example Jun 7, 2017
@Octachron
Copy link
Copy Markdown
Member Author

Disabling the difference of behaviors is quite straightforward. I am not sure how it implies a need for explicitness of the mode: we could also default to the current behavior. Nevertheless, being explicit would probably be better in a future where the two modes are rendered differently. So it might be better to make [optional|vebatim] non optional (and transform them to {optional|verbatim} to follow latex conventions).

@Octachron
Copy link
Copy Markdown
Member Author

I went ahead and made toplevel|verbatim a non-optional argument of the caml_example environment.

@Octachron Octachron force-pushed the tune_caml_example branch from d4de342 to 488dbd9 Compare June 7, 2017 16:31
@gasche
Copy link
Copy Markdown
Member

gasche commented Jun 7, 2017

This is great, thanks! I'll wait for the CI results, but then you or I could merge.

@gasche gasche merged commit f4d9001 into ocaml:trunk Jun 7, 2017
@gasche
Copy link
Copy Markdown
Member

gasche commented Jun 7, 2017

Merged. Thanks for the reactivity. Now we can resume business on MPR#7551.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants