Exemplo n.º 1
0
 /// <exception cref="NotSupportedException">Always thrown.</exception>
 public void Grow(int end, int beginning, ZilObject defaultValue)
 {
     throw new NotSupportedException();
 }
Exemplo n.º 2
0
 public ZilAdecl([NotNull] ZilObject first, [NotNull] ZilObject second)
 {
     First  = first ?? throw new ArgumentNullException(nameof(first));
     Second = second ?? throw new ArgumentNullException(nameof(second));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Determines whether another <see cref="ZilObject"/> is "the same object" as the current one,
 /// for the purposes of <c>==?</c> and <c>N==?</c> comparisons.
 /// </summary>
 /// <param name="other">The other object.</param>
 /// <returns><see langword="true"/> if the objects are identical; otherwise <see langword="false"/>.</returns>
 /// <remarks>
 /// MDL defines <c>==?</c> as being true iff the objects are made up of the same bits in
 /// MDL's internal representation. For non-structured types, this means they have the same <c>TYPE</c> and value.
 /// For structured types, it means they reference the same location in the same structure; for values of
 /// <c>PRIMTYPE</c> <c>LIST</c>, they may also both be empty.
 /// </remarks>
 /// <seealso cref="StructurallyEquals"/>
 public virtual bool ExactlyEquals(ZilObject other)
 {
     return(ReferenceEquals(this, other));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Determines whether another <see cref="ZilObject"/> is "structurally equal" or "looks the same"
 /// as the current one, for the purposes of <c>=?</c> and <c>N=?</c> comparisons.
 /// </summary>
 /// <param name="other">The other object.</param>
 /// <returns><see langword="true"/> if the objects are structurally equal; otherwise <see langword="false"/>.</returns>
 /// <remarks>
 /// MDL defines <c>=?</c> as being true for non-structured objects iff they are "the same object" (<c>==?</c>);
 /// and for structured objects if they have the same <c>TYPE</c>, same length, and each element in one is
 /// <c>=?</c> to the corresponding element in the other.
 /// </remarks>
 /// <seealso cref="ExactlyEquals"/>
 public virtual bool StructurallyEquals([CanBeNull] ZilObject other)
 {
     return(Equals(other));
 }
Exemplo n.º 5
0
 public void Grow(int end, int beginning, ZilObject defaultValue)
 {
     storage.Grow(end, beginning, defaultValue);
 }
Exemplo n.º 6
0
 public bool IsCons([CanBeNull] out ZilObject first, [CanBeNull] out ZilListoidBase rest)
 {
     (first, rest) = (this.First, this.Rest);
     Debug.Assert(first == null && rest == null || first != null && rest != null);
     return(first != null);
 }
Exemplo n.º 7
0
 static ZilObject MakeSpliceExpandable(ZilObject zo)
 {
     (zo as ZilSplice)?.SetSpliceableFlag();
     return(zo);
 }
Exemplo n.º 8
0
 public ZilForm(ZilObject first, ZilListoidBase rest)
     : base(first, rest)
 {
 }
Exemplo n.º 9
0
 public override bool StructurallyEquals(ZilObject obj)
 {
     return(obj is ZilEvalMacro other && other.WrappedValue.StructurallyEquals(WrappedValue));
 }
Exemplo n.º 10
0
 public ZilEvalMacro(ZilObject value)
 {
     WrappedValue = value;
 }
Exemplo n.º 11
0
 public override bool ExactlyEquals(ZilObject obj)
 {
     return(obj is ZilChar other && other.value == value);
 }
Exemplo n.º 12
0
 public sealed override bool StructurallyEquals(ZilObject other)
 {
     return(other is ZilHashBase <TPrim> hash && hash.type == type &&
            ((ZilObject)(object)hash.primValue).StructurallyEquals((ZilObject)(object)primValue));
 }
Exemplo n.º 13
0
 public override bool ExactlyEquals(ZilObject obj)
 {
     return((obj as ZilString)?.Text.Equals(Text) ?? false);
 }
Exemplo n.º 14
0
 public void Deconstruct([NotNull] out ZilObject first, [NotNull] out ZilObject second)
 {
     first  = this.First;
     second = this.Second;
 }
Exemplo n.º 15
0
 public override bool StructurallyEquals(ZilObject obj)
 {
     return(obj is ZilVector other && this.SequenceStructurallyEqual(other));
 }
Exemplo n.º 16
0
 public override bool StructurallyEquals(ZilObject obj)
 {
     return(obj is ZilAdecl other && other.First.StructurallyEquals(First) && other.Second.StructurallyEquals(Second));
 }
Exemplo n.º 17
0
 public ZilMacroResult([NotNull] ZilObject inner)
 {
     this.Inner = inner;
 }