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

pa_macro: allow omiting "ELSE" branch in expressions. #8345

Closed
vicuna opened this Issue Oct 29, 2003 · 1 comment

Comments

Projects
None yet
1 participant
@vicuna
Copy link
Collaborator

vicuna commented Oct 29, 2003

Original bug ID: 1902
Reporter: administrator
Status: closed
Resolution: won't fix
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Aleksey Nogin
Version: 3.07pl2
OS: Red Hat Linux
Submission from: charter-182-203.caltech.edu (131.215.182.203)

The new pa_macro package requires a complete "IFDEF ... THEN ... ELSE ... END"
in expressions. It would be nice if a shorter "IFDEF ... THEN ... END" form
without an explicit "ELSE" was allowed (where the omited "ELSE" branch is
interpreted as a unit epression).

A simple patch is at http://nogin.org/patches/ocaml-3.07-macro-noelse.patch
(note the patch is supposed to be applied on top of
http://nogin.org/patches/ocaml-3.07-macro-endif.patch of #1901)

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jun 29, 2004

Comment author: administrator

I think it's better to be explicit and to write ELSE () in expressions and
patterns, for at least 3 reasons: 1/ it keeps a symmetry between exprs and
patts, and 2/ a default unit value is arbitrary, and 3/ an explicit ELSE branch
is easy to read even to those not faniliar with pa_macros.

MM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.