uCalc API Version: 5.7.0-preview.1 Released: 7/30/2026
Warning
uCalc API Preview Release Notice:This preview documentation describes the intended behavior of the API. It is not fully accurate or complete.The current preview build contains incomplete features, unoptimized performance, and is subject to breaking changes.Use of the preview version in your production code is not recommended.
Product:
Class:
Retrieves the next item in a sequence of overloaded or shadowed symbols that share the same name.
Returns the next Item object in the overload chain. If there are no more overloads, it returns an empty Item for which IsProperty(ItemIs::NotFound) is true.
The NextOverload method provides a way to traverse the chain of items that share the same name within a uCalc instance. When multiple functions, operators, or even variables are defined with the same name, they form an implicit, stack-like list. This method acts as an iterator to walk through that list.
Think of symbols with the same name as a linked list:
NextOverload() on that item returns the previously defined item with the same name.NextOverload() returns an empty Item object. You can check for this termination condition using item.NotEmpty() or item.IsProperty(ItemIs::NotFound) == false.This mechanism is essential for introspection and managing complex symbol tables.
NextOverload allows you to access the previous value or definition.A common pattern for iterating through all overloads is a while loop:
csharp
var item = uc.ItemOf("SymbolName");
while (item.NotEmpty()) {
Console.WriteLine(item.Text()); // Process the current item
item = item.NextOverload(); // Move to the next one
}
In compiled languages like C# or C++, function overloading is a compile-time concept. The compiler selects the correct method based on the arguments provided, and there is no built-in mechanism to programmatically iterate through all available overloads at runtime. This is a key differentiator for uCalc.
NextOverload gives uCalc powerful runtime introspection and metaprogramming capabilities. It allows your application to analyze its own defined symbol space, a feature more common in highly dynamic languages like LISP or Smalltalk, but made accessible here in a simple, procedural way.
ID: 51
using uCalcSoftware;
var uc = new uCalc();
var PlusOperator = uc.ItemOf("+");
while (PlusOperator.NotEmpty()) {
Console.WriteLine("Def: " + PlusOperator.Text + " Type: " + PlusOperator.DataType.Name);
PlusOperator = PlusOperator.NextOverload();
}
Def: Operator: 70 +{x} Type: double
Def: Operator: 50 {x} + {y} Type: double
Def: Operator: 50 {x As Int} + {y As Int} As Int Type: int
Def: Operator: 50 {x As String} + {y As String} As String Type: string
Def: Operator: 50 {x As Complex} + {y As Complex} As Complex Type: complex
Def: Operator: 50 {ByHandle x As AnyType Ptr} + {y As Int} As SameTypeAs:0 Ptr Type: sametypeas:ptr
Def: Operator: 50 {ByHandle x As AnyType} + {ByHandle y As String} As String Type: string
Def: Operator: 50 {ByHandle x As String} + {ByHandle y As AnyType} As String Type: string using uCalcSoftware; var uc = new uCalc(); var PlusOperator = uc.ItemOf("+"); while (PlusOperator.NotEmpty()) { Console.WriteLine("Def: " + PlusOperator.Text + " Type: " + PlusOperator.DataType.Name); PlusOperator = PlusOperator.NextOverload(); }
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
auto PlusOperator = uc.ItemOf("+");
while (PlusOperator.NotEmpty()) {
cout << "Def: " + PlusOperator.Text() + " Type: " + PlusOperator.DataType().Name() << endl;
PlusOperator = PlusOperator.NextOverload();
}
}
Def: Operator: 70 +{x} Type: double
Def: Operator: 50 {x} + {y} Type: double
Def: Operator: 50 {x As Int} + {y As Int} As Int Type: int
Def: Operator: 50 {x As String} + {y As String} As String Type: string
Def: Operator: 50 {x As Complex} + {y As Complex} As Complex Type: complex
Def: Operator: 50 {ByHandle x As AnyType Ptr} + {y As Int} As SameTypeAs:0 Ptr Type: sametypeas:ptr
Def: Operator: 50 {ByHandle x As AnyType} + {ByHandle y As String} As String Type: string
Def: Operator: 50 {ByHandle x As String} + {ByHandle y As AnyType} As String Type: string #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; auto PlusOperator = uc.ItemOf("+"); while (PlusOperator.NotEmpty()) { cout << "Def: " + PlusOperator.Text() + " Type: " + PlusOperator.DataType().Name() << endl; PlusOperator = PlusOperator.NextOverload(); } }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim PlusOperator = uc.ItemOf("+")
While PlusOperator.NotEmpty()
Console.WriteLine("Def: " + PlusOperator.Text + " Type: " + PlusOperator.DataType.Name)
PlusOperator = PlusOperator.NextOverload()
End While
End Sub
End Module
Def: Operator: 70 +{x} Type: double
Def: Operator: 50 {x} + {y} Type: double
Def: Operator: 50 {x As Int} + {y As Int} As Int Type: int
Def: Operator: 50 {x As String} + {y As String} As String Type: string
Def: Operator: 50 {x As Complex} + {y As Complex} As Complex Type: complex
Def: Operator: 50 {ByHandle x As AnyType Ptr} + {y As Int} As SameTypeAs:0 Ptr Type: sametypeas:ptr
Def: Operator: 50 {ByHandle x As AnyType} + {ByHandle y As String} As String Type: string
Def: Operator: 50 {ByHandle x As String} + {ByHandle y As AnyType} As String Type: string Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim PlusOperator = uc.ItemOf("+") While PlusOperator.NotEmpty() Console.WriteLine("Def: " + PlusOperator.Text + " Type: " + PlusOperator.DataType.Name) PlusOperator = PlusOperator.NextOverload() End While End Sub End Module