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

Fix for static interfaces with non-static methods #1

Merged
merged 3 commits into from
Oct 12, 2015
Merged

Conversation

zhengbli
Copy link
Contributor

@zhengbli zhengbli commented Oct 8, 2015

Pt.printl "}"
Pt.printl ""
Pt.printl "declare var %s: {" i.Name
Pt.increaseIndent()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to consider using a helper function like

let indentFor dump =
    Pt.increaseIndent()
    dump()
    Pt.decreaseIndent()

Also, "dump" is such an unappealing word. Maybe emit would be better if you're up to making that change in the future 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then how should I use indentFor? It seems then I need to wrap up the arbitrary print statements to a function then pass it to the indentFor everytime, which might be verbose as well?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It prevents you from forgetting to decreaseIndent each time. It's only a suggestion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Maybe something like the with keyword or using in C#. I'll look into it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW the word Dump is because it was called so in the old script :) Emit does sound better

zhengbli added a commit that referenced this pull request Oct 12, 2015
Fix for static interfaces with non-static methods
@zhengbli zhengbli merged commit bfb9db0 into master Oct 12, 2015
@zhengbli zhengbli deleted the fixConstants branch October 12, 2015 18:29
zhengbli pushed a commit that referenced this pull request Jan 14, 2016
mhegazy pushed a commit that referenced this pull request Jan 8, 2018
mhegazy pushed a commit that referenced this pull request Jun 13, 2018
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.

3 participants