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
Any Records

Métodos

Equal<T : IHashable<T>>(T[] a, T[] b) : bool
#

static

Whether two arrays hold equal elements in the same order.

Hash<T : IHashable<T>>(T[] a) : u64
#

static

A hash of the elements in order (equal arrays hash alike).

Text<T : IToString>(T[] a) : str
#

static

[a, b, c].

Same<T : IHashable<T>>(T a, T b) : bool
#

static

Whether two values are equal (the type's Equals).

HashOf<T : IHashable<T>>(T value) : u64
#

static

The value's Hash().

TextOf<T : IToString>(T value) : str
#

static

The value's ToString().

SameObject(any a, any b) : bool
#

static

An object without Equals: equal to itself only.

ObjectHash(any value) : u64
#

static

An object without IHashable: any's Hash().

ObjectText(any value) : str
#

static

An object without IToString: any's ToString() (its class's name unless the class says otherwise).

NoSame<T>(T a, T b) : bool
#

static

A value without Equals: never equal to another.

NoHash<T>(T value) : u64
#

static

A value without Hash(): 0.

NoText<T>(T value) : str
#

static

A value without ToString().

NullText() : str
#

static

What a null object shows as.

Miembros heredados (5)

Código fuente

Records en Antril, descompilado a partir de su Larva HIR.

System.Records.ant
// 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";
	}
}
Esc