OshaqHennessey
Coding on mobile is hard
I'm glad you noticed. That was my favorite part too.
Yeah, it does look like C now that I think about it. You're right about the end result too. I believe C# will let you do inline declaration and assignment like that, so maybe that's what we're looking at? Been a while, could be wrong
I just tested it in PowerShell. Works fine
$i = 1
$x = -$i
$x
Outputs -1
It's an incoherent hodgepodge of C#/.NET, PowerShell, and JavaScript, each of which I've forgotten more about than I currently know
function myFunction() {
try {
x = new Random().nextInt();
if (x != 10) {
throw "not 10";
}
else {
return (10)
}
catch(err) {
myFunction()
}
}
}
x = myFunction()
Commit notes: Added error handling
function foo() {
x = new Random();
case (x = 10):
return (x);
default:
foo()
}
Shit, you're right. x is declared inside the loop, so it doesn't exist until the loop begins execution.
Technically, I suppose you could say the compiler will allocate memory for x without assigning a value before the loop is executed and... I'm understanding what you mean now, I think.