uCalc API Version: 2.1.3-preview.2 Released: 6/16/2026
Warning
uCalc API Preview Release Notice:The documentation describes the intended behavior of the API. The current preview build contains incomplete features, unoptimized performance, and is subject to breaking changes.
Item = [Item]
Property
Product:
Class:
Retrieves the underlying Item object that represents this data type, enabling access to common symbol properties.
Remarks
In the uCalc engine, every defined symbol—whether it's a variable, function, or even a data type—is fundamentally represented by a universal Item object. This method serves as the bridge, allowing you to access the underlying Item for a specific DataType instance.
By retrieving the Item, you can treat a data type polymorphically and use the common Item interface to:
- Get its registered Name().
- Read or set its Description().
- Check its properties with IsProperty() (e.g.,
IsProperty(ItemIs::DataType)). - Release() a user-defined data type from memory.
💡 Comparative Analysis
This concept is similar to reflection in languages like C# or Java.
- In C#,
typeof(int)returns aSystem.Typeobject. - In uCalc, uc.DataTypeOf("Int") returns a
DataTypeobject, and calling.Item()on that object provides access to the unified symbol table representation.
The key difference is that uCalc's Item provides a consistent interface for all engine symbols, not just types, simplifying introspection logic.
Examples
A succinct example showing how to retrieve the Item from a DataType to access its name.
using uCalcSoftware;
var uc = new uCalc();
var intType = uc.DataTypeOf(BuiltInType.Integer_32);
// Get the Item representation of the DataType
var itemHandle = intType.Item;
Console.WriteLine($"Data Type Name via Item: {itemHandle.Name}");
Data Type Name via Item: int using uCalcSoftware; var uc = new uCalc(); var intType = uc.DataTypeOf(BuiltInType.Integer_32); // Get the Item representation of the DataType var itemHandle = intType.Item; Console.WriteLine($"Data Type Name via Item: {itemHandle.Name}");
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
auto intType = uc.DataTypeOf(BuiltInType::Integer_32);
// Get the Item representation of the DataType
auto itemHandle = intType.Item();
cout << "Data Type Name via Item: " << itemHandle.Name() << endl;
}
Data Type Name via Item: int #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; auto intType = uc.DataTypeOf(BuiltInType::Integer_32); // Get the Item representation of the DataType auto itemHandle = intType.Item(); cout << "Data Type Name via Item: " << itemHandle.Name() << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim intType = uc.DataTypeOf(BuiltInType.Integer_32)
'// Get the Item representation of the DataType
Dim itemHandle = intType.Item
Console.WriteLine($"Data Type Name via Item: {itemHandle.Name}")
End Sub
End Module
Data Type Name via Item: int Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim intType = uc.DataTypeOf(BuiltInType.Integer_32) '// Get the Item representation of the DataType Dim itemHandle = intType.Item Console.WriteLine($"Data Type Name via Item: {itemHandle.Name}") End Sub End Module
Internal test to verify behavior when retrieving the Item for a non-existent data type.
using uCalcSoftware;
var uc = new uCalc();
// Attempt to get an invalid DataType
var invalidType = uc.DataTypeOf("NoSuchType");
// Get its Item representation
var invalidItem = invalidType.Item;
// Check its properties
Console.WriteLine($"Item Is Found: {! invalidItem.IsProperty(ItemIs.NotFound)}");
Console.WriteLine($"Item Name: '{invalidItem.Name}'");
Item Is Found: False
Item Name: '' using uCalcSoftware; var uc = new uCalc(); // Attempt to get an invalid DataType var invalidType = uc.DataTypeOf("NoSuchType"); // Get its Item representation var invalidItem = invalidType.Item; // Check its properties Console.WriteLine($"Item Is Found: {! invalidItem.IsProperty(ItemIs.NotFound)}"); Console.WriteLine($"Item Name: '{invalidItem.Name}'");
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
#define tf(IsTrue) ((IsTrue) ? "True" : "False")
int main() {
uCalc uc;
// Attempt to get an invalid DataType
auto invalidType = uc.DataTypeOf("NoSuchType");
// Get its Item representation
auto invalidItem = invalidType.Item();
// Check its properties
cout << "Item Is Found: " << tf(! invalidItem.IsProperty(ItemIs::NotFound)) << endl;
cout << "Item Name: '" << invalidItem.Name() << "'" << endl;
}
Item Is Found: False
Item Name: '' #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; #define tf(IsTrue) ((IsTrue) ? "True" : "False") int main() { uCalc uc; // Attempt to get an invalid DataType auto invalidType = uc.DataTypeOf("NoSuchType"); // Get its Item representation auto invalidItem = invalidType.Item(); // Check its properties cout << "Item Is Found: " << tf(! invalidItem.IsProperty(ItemIs::NotFound)) << endl; cout << "Item Name: '" << invalidItem.Name() << "'" << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
'// Attempt to get an invalid DataType
Dim invalidType = uc.DataTypeOf("NoSuchType")
'// Get its Item representation
Dim invalidItem = invalidType.Item
'// Check its properties
Console.WriteLine($"Item Is Found: {Not invalidItem.IsProperty(ItemIs.NotFound)}")
Console.WriteLine($"Item Name: '{invalidItem.Name}'")
End Sub
End Module
Item Is Found: False
Item Name: '' Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() '// Attempt to get an invalid DataType Dim invalidType = uc.DataTypeOf("NoSuchType") '// Get its Item representation Dim invalidItem = invalidType.Item '// Check its properties Console.WriteLine($"Item Is Found: {Not invalidItem.IsProperty(ItemIs.NotFound)}") Console.WriteLine($"Item Name: '{invalidItem.Name}'") End Sub End Module