using uCalcSoftware; var uc = new uCalc(); // Internal Test: Context integrity after cloning var baseUc = new uCalc(); baseUc.DefineVariable("x = 100"); // Clone the base instance and modify the variable in the clone var clonedUc = baseUc.Clone(); clonedUc.Eval("x = 200"); // Parse an expression in the original base context var baseExpr = baseUc.Parse("x"); // 1. Verify the expression evaluates using its original context's value Console.WriteLine($"Base expression evaluates to: {baseExpr.Evaluate()}"); // 2. Get the parent and verify it is not the cloned instance Console.WriteLine($"Parent is not the clone: {baseExpr.uCalc.MemoryIndex != clonedUc.MemoryIndex}");