Order of Exclamation Marks
Code should be ran in the order of least exclamation marks to most exclamation marks (matching Overloading) ex:
print(hello_world)! // hello world
const const hello_world = "hello world"!!
the second line will be ran first because it has more exclamation marks
print(hello_world)??
const const const hello_world = "hi"?
The second line should be ran first because the author is less unsure about the second line compared to the first one (fewer question marks).
How would this work with reverse? Would reverse go backwards in the determined execution order?
The second line should be ran first because the author is less unsure about the second line compared to the first one (less question marks).
and anything with ! should be ran before ? because the user is more sure
CODE:
print("World")?
print("Hello")!
OUTPUT (without debug)
Hello
World
How would this work with reverse? Would reverse go backwards in the determined execution order?
The way I would imagine it happening is the "compiler" would rearrange the code
USER TYPED:
print("World")!
print("Hello")!!
COMPILER REARRANGED:
print("Hello")!
print("World")!
OUTPUT:
Hello
World
so reverse would reverse the order of the rearranged code
so reverse would reverse the order of the rearranged code
ah, so reverse happens after the Determined Exclamation Execution reZolution (No Use of TypeScript) step.
and anything with ! should be ran before ? because the user is more sure
Similar to that, this would be the order:
!!!! // Run first
!!!
!!
!
?
??
???
???? // Run Last
Also from Overloading we will be also using upside down question and exclamation marks with the order. :)