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

Define how "Assert:" works #98

Merged
merged 2 commits into from
Mar 24, 2017
Merged

Define how "Assert:" works #98

merged 2 commits into from
Mar 24, 2017

Conversation

annevk
Copy link
Member

@annevk annevk commented Mar 23, 2017

See #87 for direct inspiration, though we’ve been using this here and
there for a while now.


Preview | Diff

See #87 for direct inspiration, though we’ve been using this here and
there for a while now.
Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

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

I'd add something like

If an assertion ends up being violated, that indicates a bug in the specification, and that subsequent steps in the algorithm are unlikely to work as expected. (It does not indicate any specific runtime behavior such as throwing an exception.)

infra.bs Outdated
<h3 id=assertions>Assertions</h3>

<p>To improve readability, it can sometimes help to add assertions to algorithms, stating
invariants. To do this, write "<code>Assert: </code>", followed by a statement that must be true.
Copy link
Member

Choose a reason for hiding this comment

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

This should not be <code>; just normal font is fine.

Copy link
Member Author

Choose a reason for hiding this comment

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

Elsewhere we say that strings should use code.

Copy link
Member Author

Choose a reason for hiding this comment

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

But I guess we haven't done it for algorithm keywords per se.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah this isn't a string in the sense of the data type.

@annevk
Copy link
Member Author

annevk commented Mar 24, 2017

Shall I add that as a note?

@domenic
Copy link
Member

domenic commented Mar 24, 2017

Not sure if it's a note or normative; I could go either way.

@annevk
Copy link
Member Author

annevk commented Mar 24, 2017

Added a bit.

@domenic domenic merged commit 6d76126 into master Mar 24, 2017
@domenic domenic deleted the annevk/assertions branch March 24, 2017 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants