Table of Contents

Struct Lambda

Namespace
xFunc.Maths.Expressions
Assembly
xFunc.Maths.dll

Represents the custom function without name.

public readonly struct Lambda : IEquatable<Lambda>
Implements
Inherited Members

Constructors

Lambda(IEnumerable<string>, IExpression)

Initializes a new instance of the Lambda struct.

public Lambda(IEnumerable<string> parameters, IExpression body)

Parameters

parameters IEnumerable<string>

The list of parameters of the function.

body IExpression

The body of the function.

Lambda(ImmutableArray<string>, IExpression)

Initializes a new instance of the Lambda struct.

public Lambda(ImmutableArray<string> parameters, IExpression body)

Parameters

parameters ImmutableArray<string>

The list of parameters of the function.

body IExpression

The body of the function.

Lambda(IExpression)

Initializes a new instance of the Lambda struct.

public Lambda(IExpression body)

Parameters

body IExpression

The body of the function.

Properties

Body

Gets an expression of the function body.

public IExpression Body { get; }

Property Value

IExpression

Parameters

Gets a list of parameters.

public ImmutableArray<string> Parameters { get; }

Property Value

ImmutableArray<string>

Methods

AsExpression()

Converts Lambda to LambdaExpression.

public LambdaExpression AsExpression()

Returns

LambdaExpression

The function expression.

Call(ImmutableArray<IExpression>, ExpressionParameters?)

Calls the function.

public object Call(ImmutableArray<IExpression> callParameters, ExpressionParameters? expressionParameters)

Parameters

callParameters ImmutableArray<IExpression>

The list of explicit parameters to call lambda with.

expressionParameters ExpressionParameters

An object that contains all parameters and functions for expressions.

Returns

object

A result of the execution.

See Also

Call(ExpressionParameters?)

Calls the function.

public object Call(ExpressionParameters? parameters)

Parameters

parameters ExpressionParameters

An object that contains all parameters and functions for expressions.

Returns

object

A result of the execution.

Capture(ExpressionParameters?)

Returns a new lambda instance with captured parameters.

public Lambda Capture(ExpressionParameters? parameters)

Parameters

parameters ExpressionParameters

An object that contains all parameters and functions for expressions.

Returns

Lambda

The lambda with captured parameters.

Curry()

Converts the current lambda into a list of nested lambdas.

public Lambda Curry()

Returns

Lambda

The lambda.

See Also

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

Equals(Lambda)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(Lambda other)

Parameters

other Lambda

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

operator ==(Lambda, Lambda)

Determines whether two specified instances of Lambda are equal.

public static bool operator ==(Lambda left, Lambda right)

Parameters

left Lambda

The first object to compare.

right Lambda

The second object to compare.

Returns

bool

true if left is equal to right; otherwise, false.

operator !=(Lambda, Lambda)

Determines whether two specified instances of Lambda are not equal.

public static bool operator !=(Lambda left, Lambda right)

Parameters

left Lambda

The first object to compare.

right Lambda

The second object to compare.

Returns

bool

true if left is not equal to right; otherwise, false.