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

Permit DO to raise errors again #120

Merged
merged 1 commit into from
Oct 12, 2015
Merged

Permit DO to raise errors again #120

merged 1 commit into from
Oct 12, 2015

Conversation

hostilefork
Copy link
Member

When FAIL was conceived, it seemed that letting DO raise errors was
encouraging of unclear practices. (DO X doesn't look like a failure or
exception triggering mechanism if you don't know that X is an error, and
it's not that great of a way of saying it even if it's clear that it is an error.)
So DO of an ERROR! was turned into a different error than the one you
asked for...instructing you to use FAIL instead.

This was creating a bit of a bump, and likely an unnecessary one. If DO
of an ERROR! is just going to give you an error anyway, it might as well
give the error you asked for.

However, THROW not allowing you to pass it an ERROR! is important and
being kept. If THROW is used instead of FAIL (or DO) then it will confuse
matters with TRAP, making it seem surprising that a thrown error could
not be trapped. The message for trying to THROW an error helps to
reinforce that you shouldn't use DO by mentioning not to use either THROW
or DO (even though DO will now continue to work).

Making the ergonomics a little easier, THROW of an ERROR! now puts the
error as the argument to the "do not throw error!"...so you can read what it
was and get an error, while still getting the advice.

When FAIL was conceived, it seemed that letting DO raise errors was
encouraging of unclear practices.  (DO X doesn't look like a failure or
exception triggering mechanism if you don't know that X is an error, and
it's not that great of a way of saying it even if it's clear that it is an error.)
So DO of an ERROR! was turned into a different error than the one you
asked for...instructing you to use FAIL instead.

This was creating a bit of a bump, and likely an unnecessary one.  If DO
of an ERROR! is just going to give you an error anyway, it might as well
give the error you asked for.

However, THROW not allowing you to pass it an ERROR! is important and
being kept.  If THROW is used instead of FAIL (or DO) then it will confuse
matters with TRAP, making it seem surprising that a thrown error could
not be trapped.  The message for trying to THROW an error helps to
reinforce that you shouldn't use DO my mentioning not to use either THROW
or DO (even though DO will now continue to work).

Making the ergonomics a little easier, THROW of an ERROR! now puts the
error as the argument to the "do not throw error!"...so you can read what it
was *and* get an error, while still getting the advice.
@hostilefork hostilefork merged commit 0e2e245 into metaeducation:master Oct 12, 2015
@hostilefork hostilefork deleted the do-raises-errors branch October 13, 2015 06:13
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.

1 participant