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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/boot/errors.r
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Script: [
; !!! Temporary errors while faulty constructs are still outstanding
; (more informative than just saying "function doesn't take that type")
use-eval-for-eval: {Use EVAL (not DO) for inline evaluation of a value}
use-fail-for-error: {Use FAIL (instead of THROW or DO) to trigger ERROR!}
use-fail-for-error: [{Use FAIL (not THROW or DO) to raise} :arg1]
use-split-simple: {Use SPLIT (instead of PARSE) for "simple" parsing}

limited-fail-input: {FAIL requires complex expressions to be in a PAREN!}
Expand Down
1 change: 0 additions & 1 deletion src/boot/sysobj.r
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ options: context [ ; Options supplied to REBOL during startup
exit-functions-only: false
broken-case-semantics: false
do-runs-functions: false
do-raises-errors: false
datatype-word-strict: false
group-not-paren: false ;; bias the default to PAREN! vs GROUP! (for now...)
refinements-true: false
Expand Down
18 changes: 9 additions & 9 deletions src/core/n-control.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,11 +677,11 @@ enum {
// trying to use it to trigger errors, because if THROW just didn't
// take errors in the spec it wouldn't guide what *to* use.
//
raise Error_0(RE_USE_FAIL_FOR_ERROR);
raise Error_1(RE_USE_FAIL_FOR_ERROR, value);

// Note: Caller can put the ERROR! in a block or use some other
// such trick if it wants to actually throw an error.
// (Better than complicating throw with /error-is-intentional!)
// (Better than complicating via THROW/ERROR-IS-INTENTIONAL!)
}

if (named) {
Expand Down Expand Up @@ -846,13 +846,13 @@ enum {
return R_OUT;

case REB_ERROR:
#if !defined(NDEBUG)
if (LEGACY(OPTIONS_DO_RAISES_ERRORS))
raise Error_Is(value);
#endif
// This path will no longer raise the error you asked for, though it
// will still raise *an* error directing you to use FAIL.)
raise Error_0(RE_USE_FAIL_FOR_ERROR);
// FAIL is the preferred operation for triggering errors, as it has
// a natural behavior for blocks passed to construct readable messages
// and "FAIL X" more clearly communicates a failure than "DO X"
// does. However DO of an ERROR! would have to raise an error
// anyway, so it might as well raise the one it is given.
//
raise Error_Is(value);

case REB_TASK:
Do_Task(value);
Expand Down
1 change: 0 additions & 1 deletion src/mezz/mezz-legacy.r
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ set 'r3-legacy* func [] [
; at different times on a case-by-case basis.
;
system/options/do-runs-functions: true
system/options/do-raises-errors: true
system/options/broken-case-semantics: true
system/options/exit-functions-only: true
system/options/datatype-word-strict: true
Expand Down