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
parametersIEnumerable<string>The list of parameters of the function.
bodyIExpressionThe body of the function.
Lambda(ImmutableArray<string>, IExpression)
Initializes a new instance of the Lambda struct.
public Lambda(ImmutableArray<string> parameters, IExpression body)
Parameters
parametersImmutableArray<string>The list of parameters of the function.
bodyIExpressionThe body of the function.
Lambda(IExpression)
Initializes a new instance of the Lambda struct.
public Lambda(IExpression body)
Parameters
bodyIExpressionThe body of the function.
Properties
Body
Gets an expression of the function body.
public IExpression Body { get; }
Property Value
Parameters
Gets a list of parameters.
public ImmutableArray<string> Parameters { get; }
Property Value
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
callParametersImmutableArray<IExpression>The list of explicit parameters to call lambda with.
expressionParametersExpressionParametersAn 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
parametersExpressionParametersAn 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
parametersExpressionParametersAn 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
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand 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
otherLambdaAn object to compare with this object.
Returns
GetHashCode()
Returns the hash code for this instance.
[ExcludeFromCodeCoverage]
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
Returns
- bool
trueifleftis equal toright; otherwise,false.
operator !=(Lambda, Lambda)
Determines whether two specified instances of Lambda are not equal.
public static bool operator !=(Lambda left, Lambda right)
Parameters
Returns
- bool
trueifleftis not equal toright; otherwise,false.