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

Style for nested if expressions? #46

Closed
HarrisonGrodin opened this issue Dec 27, 2021 · 0 comments
Closed

Style for nested if expressions? #46

HarrisonGrodin opened this issue Dec 27, 2021 · 0 comments
Labels
aesthetics Improvement to code formatter output question Further information is requested

Comments

@HarrisonGrodin
Copy link
Collaborator

Following up on the discussion here.

Current approach is:

if b then
  if b' then
    e11
  else
    e10
else if b' then
  e01
else
  e00

Alternative might be:

if b then
  if b' then
    e11
  else
    e10
else
  if b' then
    e01
  else
    e00

The former is better for chained if conditions in the else clauses (else if ...), whereas the latter is more symmetric/compositional.

@HarrisonGrodin HarrisonGrodin added question Further information is requested aesthetics Improvement to code formatter output labels Dec 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aesthetics Improvement to code formatter output question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants