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

Safer/richer indentation abstraction #30

Closed
olafurpg opened this issue Jan 19, 2016 · 1 comment
Closed

Safer/richer indentation abstraction #30

olafurpg opened this issue Jan 19, 2016 · 1 comment

Comments

@olafurpg
Copy link
Member

The indentation is managed by State.indent: Int. Splits and policies can increment/decrement the int.

  • This makes it tricky for example to indent a function argument to the same column as the opening ( because we don't know the exact integer value of the state's column.
  • unindenting the same number of spaces at the closing ) requires us to know integer value at the opening )
  • We violate DRY by relying on decrementing the same number as we increment.

A more powerful abstraction would work like a stack, you push an Indent which can be a concrete number or a useful object like state.column

@olafurpg
Copy link
Member Author

Closed by #31

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

No branches or pull requests

1 participant