Skip to content
This repository was archived by the owner on Jan 25, 2022. It is now read-only.

Use an abrupt completion for speccing short-circuiting? #11

Closed
claudepache opened this issue Jul 18, 2017 · 1 comment
Closed

Use an abrupt completion for speccing short-circuiting? #11

claudepache opened this issue Jul 18, 2017 · 1 comment

Comments

@claudepache
Copy link
Collaborator

claudepache commented Jul 18, 2017

From #10 (comment)

For me, I feel more comfortable with the short-circuiting concept if it can be explained syntactically, as C# does, rather than by the propagation of a Nil value. Although both of these are spec devices, it seems like they leak out into the mental model that programmers will use when understanding the scope.

As an alternative to Nil reference, another — and psychologically probably better — way to spec short-circuiting, is a new type of abrupt completion whose propagation is stopped at the boundary of a LeftHandSideExpression. At first sight, it should be feasible without too much pain.

Spec-wise, the main difference between Nil reference and Nil abrupt completion, is that the reference must be propagated at specific points, while the abrupt completion must have its propagation be stopped at other specific points.

@claudepache
Copy link
Collaborator Author

After more careful consideration, that would be more complicated and/or more brittle. Now I recall why I had specifically chosen a Reference instead of anything else.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant