static class · System
Records
public static class Records
- Tipo
- static class
- Espacio de nombres
- System
- Ensamblado
- System.Core
- Acceso
- public, static, abstract
- Archivo fuente
Records.ant
Herencia
- Clases base
-
AnyRecords
Métodos
Whether two arrays hold equal elements in the same order.
A hash of the elements in order (equal arrays hash alike).
[a, b, c].
Whether two values are equal (the type's Equals).
The value's Hash().
The value's ToString().
An object without Equals: equal to itself only.
An object without IHashable: any's Hash().
ObjectText(any value) : str
#
An object without IToString: any's ToString() (its class's name unless the class says otherwise).
A value without Equals: never equal to another.
A value without Hash(): 0.
NoText<T>(T value) : str
#
A value without ToString().
NullText() : str
#
What a null object shows as.
Miembros heredados (5)
GetTypemétodo de AnyUndescribedmétodo de AnyToStringmétodo de AnyHashmétodo de Anydestroymétodo de Any
Código fuente
Records en Antril, descompilado a partir de su Larva HIR.
// System.Records — System.Core (decompiled from Larva HIR)
into namespace System
{
public static class Records
{
public:
/// Whether two arrays hold equal elements in the same order.
Equal<T : IHashable<T>>(T[] a, T[] b) : bool
{
if (a.Length != b.Length)
return false;
loop (i32 i = 0..a.Length)
{
if (!a[i].Equals(b[i]))
return false;
}
return true;
}
/// A hash of the elements in order (equal arrays hash alike).
Hash<T : IHashable<T>>(T[] a) : u64
{
u64 h = (u64)a.Length;
loop (i32 i = 0..a.Length)
h = h * 31 + a[i].Hash();
return h;
}
/// `[a, b, c]`.
Text<T : IToString>(T[] a) : str
{
StringBuilder text = new StringBuilder();
text.Append("[");
loop (i32 i = 0..a.Length)
{
if (i > 0)
text.Append(", ");
text.Append(a[i].ToString());
}
text.Append("]");
return text.ToString();
}
/// Whether two values are equal (the type's Equals).
Same<T : IHashable<T>>(T a, T b) : bool => a.Equals(b);
/// The value's Hash().
HashOf<T : IHashable<T>>(T value) : u64 => value.Hash();
/// The value's ToString().
TextOf<T : IToString>(T value) : str => value.ToString();
/// An object without Equals: equal to itself only.
SameObject(any a, any b) : bool => a == b;
/// An object without IHashable: any's Hash().
ObjectHash(any value) : u64 => value.Hash();
/// An object without IToString: any's ToString() (its class's name unless the class says otherwise).
ObjectText(any value) : str => value.ToString();
/// A value without Equals: never equal to another.
NoSame<T>(T a, T b) : bool => false;
/// A value without Hash(): 0.
NoHash<T>(T value) : u64 => 0;
/// A value without ToString().
NoText<T>(T value) : str => "?";
/// What a null object shows as.
NullText() : str => "null";
}
}