/// <exception cref="NotSupportedException">Always thrown.</exception> public void Grow(int end, int beginning, ZilObject defaultValue) { throw new NotSupportedException(); }
public ZilAdecl([NotNull] ZilObject first, [NotNull] ZilObject second) { First = first ?? throw new ArgumentNullException(nameof(first)); Second = second ?? throw new ArgumentNullException(nameof(second)); }
/// <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)); }
/// <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)); }
public void Grow(int end, int beginning, ZilObject defaultValue) { storage.Grow(end, beginning, defaultValue); }
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); }
static ZilObject MakeSpliceExpandable(ZilObject zo) { (zo as ZilSplice)?.SetSpliceableFlag(); return(zo); }
public ZilForm(ZilObject first, ZilListoidBase rest) : base(first, rest) { }
public override bool StructurallyEquals(ZilObject obj) { return(obj is ZilEvalMacro other && other.WrappedValue.StructurallyEquals(WrappedValue)); }
public ZilEvalMacro(ZilObject value) { WrappedValue = value; }
public override bool ExactlyEquals(ZilObject obj) { return(obj is ZilChar other && other.value == value); }
public sealed override bool StructurallyEquals(ZilObject other) { return(other is ZilHashBase <TPrim> hash && hash.type == type && ((ZilObject)(object)hash.primValue).StructurallyEquals((ZilObject)(object)primValue)); }
public override bool ExactlyEquals(ZilObject obj) { return((obj as ZilString)?.Text.Equals(Text) ?? false); }
public void Deconstruct([NotNull] out ZilObject first, [NotNull] out ZilObject second) { first = this.First; second = this.Second; }
public override bool StructurallyEquals(ZilObject obj) { return(obj is ZilVector other && this.SequenceStructurallyEqual(other)); }
public override bool StructurallyEquals(ZilObject obj) { return(obj is ZilAdecl other && other.First.StructurallyEquals(First) && other.Second.StructurallyEquals(Second)); }
public ZilMacroResult([NotNull] ZilObject inner) { this.Inner = inner; }