diff --git a/src/components/InteractiveCode.astro b/src/components/InteractiveCode.astro index 014faba..4d650ae 100644 --- a/src/components/InteractiveCode.astro +++ b/src/components/InteractiveCode.astro @@ -176,7 +176,7 @@ const serialized_inst = JSON.stringify(instructionSet); break; } case InstructionType.Out: { - data.stdout += i.v0 + data.stdout += i.v0.slice(1, -1) + "\n" break; } case InstructionType.Set: { @@ -186,7 +186,7 @@ const serialized_inst = JSON.stringify(instructionSet); break; } case InstructionType.Unset: { - delete data.state[i.v0]; + delete data.state[i.v0.slice(1, -1)]; break; } } diff --git a/src/pages/learn/error-handling/try.mdx b/src/pages/learn/error-handling/try.mdx index 885e632..ac2871e 100644 --- a/src/pages/learn/error-handling/try.mdx +++ b/src/pages/learn/error-handling/try.mdx @@ -153,17 +153,70 @@ In the previous example: Try/return will assign a new value if an expression fails. -```thp -fun run() -{ - val result = try dangerous() else 322 + + + +- If `possible_value` is an error, the value `666` is used. +- If `possible_value` is not an error, its value will be used. Either way, the function will continue executing.