Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
PopLast.cs
6
8{
13 {
14 private readonly VariableReference reference;
15
25 {
26 this.reference = Argument as VariableReference;
27 }
28
32 public override string FunctionName => nameof(PopLast);
33
41 {
42 int c = Argument.Dimension;
43 if (c == 0)
44 return ObjectValue.Null;
45
46 IElement Result = Argument.GetElement(c - 1);
47
48 if (!(this.reference is null))
49 {
50 ICollection<IElement> Elements = Argument.VectorElements;
52
53 foreach (IElement E in Elements)
54 {
55 if (--c > 0)
56 Elements2.Add(E);
57 }
58
59 Variables[this.reference.VariableName] = Argument.Encapsulate(Elements2, this);
60 }
61
62 return Result;
63 }
64
65 }
66}
A chunked list is a linked list of chunks of objects of type T .
Definition: ChunkedList.cs:54
Class managing a script expression.
Definition: Expression.cs:41
override string FunctionName
Name of the function
Definition: PopLast.cs:32
PopLast(ScriptNode Argument, int Start, int Length, Expression Expression)
PopLast(v)
Definition: PopLast.cs:23
override IElement EvaluateVector(IVector Argument, Variables Variables)
Evaluates the function on a vector argument.
Definition: PopLast.cs:40
ScriptNode Argument
Function argument.
Base class for funcions of one vector variable.
Base class for all nodes in a parsed script tree.
Definition: ScriptNode.cs:69
int Length
Length of expression covered by node.
Definition: ScriptNode.cs:101
int Start
Start position in script expression.
Definition: ScriptNode.cs:92
Represents a variable reference.
static readonly ObjectValue Null
Null value.
Definition: ObjectValue.cs:88
Collection of variables.
Definition: Variables.cs:25
Basic interface for all types of elements.
Definition: IElement.cs:21
Basic interface for vectors.
Definition: IVector.cs:9