If hygienicTemp is an abrupt completion, return Completion(hygienicTemp).
Else, set hygienicTemp to hygienicTemp.[[Value]].
Where hygienicTemp is ephemeral and visible only in the steps pertaining to ReturnIfAbrupt.
But it is unclear from the spec what would happen when when writes
Let val be ReturnIfAbrupt(AbstractOperation()), when the result of AbstractOperation() is not an abrubt completion.
should val be result of AbstractOperation() or AbstractOperation().[[value]] or something else?
The following section defines what “1. Let result be AbstractOperation(ReturnIfAbrupt(argument)).” means, but in most cases in spec, I see “let result be !AbstractOperation()” which is not same as this.
Also what is the difference in “1. ReturnIfAbrupt(argument).” and “1. ReturnIfAbrupt(AbstractOperation()).” that they needed to be specified seperately.
Seems like I am missing some fundamental stuff here, so would appreciate any answers. Thanks!
So, to clarify, you are saying that there is no fundamental difference in both the statement expansions, it is just for additional clarity. If the second definition hadn’t been there, it would still have the same meaning?
This brings another question to my mind
what is the purpose of 4th step in “1. ReturnIfAbrupt(AbstractOperation()).” expansion. That is “4. Else, set hygienicTemp to hygienicTemp.[[Value]].”. If hygienicTemp is ephemeral, what is the point of setting it to something?
Yeah, this section has long needed rewriting, sorry about that. I recommend ignoring it entirely and instead reading this comment. It makes no mention of ReturnIfAbrupt because the intention is to define the ! and ? macros directly, and to no longer use ReturnIfAbrupt (as of relatively recently its only remaining use is to define the ! and ? macros).
I'm not sure if the editors would agree that they have the same meaning, but to me personally, yes, they're interchangeable.
If it's not set to something then the [[Value]] can't be reused in the next step. It's a macro - it may be a helpful exercise to manually edit the spec text for a few cases to expand the macro.