コード例 #1
0
 /// <exception cref="NotSupportedException">Always thrown.</exception>
 public void Grow(int end, int beginning, ZilObject defaultValue)
 {
     throw new NotSupportedException();
 }
コード例 #2
0
 public ZilAdecl([NotNull] ZilObject first, [NotNull] ZilObject second)
 {
     First  = first ?? throw new ArgumentNullException(nameof(first));
     Second = second ?? throw new ArgumentNullException(nameof(second));
 }
コード例 #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));
 }
コード例 #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));
 }
コード例 #5
0
 public void Grow(int end, int beginning, ZilObject defaultValue)
 {
     storage.Grow(end, beginning, defaultValue);
 }
コード例 #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);
 }
コード例 #7
0
 static ZilObject MakeSpliceExpandable(ZilObject zo)
 {
     (zo as ZilSplice)?.SetSpliceableFlag();
     return(zo);
 }
コード例 #8
0
 public ZilForm(ZilObject first, ZilListoidBase rest)
     : base(first, rest)
 {
 }
コード例 #9
0
 public override bool StructurallyEquals(ZilObject obj)
 {
     return(obj is ZilEvalMacro other && other.WrappedValue.StructurallyEquals(WrappedValue));
 }
コード例 #10
0
 public ZilEvalMacro(ZilObject value)
 {
     WrappedValue = value;
 }
コード例 #11
0
 public override bool ExactlyEquals(ZilObject obj)
 {
     return(obj is ZilChar other && other.value == value);
 }
コード例 #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));
 }
コード例 #13
0
 public override bool ExactlyEquals(ZilObject obj)
 {
     return((obj as ZilString)?.Text.Equals(Text) ?? false);
 }
コード例 #14
0
 public void Deconstruct([NotNull] out ZilObject first, [NotNull] out ZilObject second)
 {
     first  = this.First;
     second = this.Second;
 }
コード例 #15
0
 public override bool StructurallyEquals(ZilObject obj)
 {
     return(obj is ZilVector other && this.SequenceStructurallyEqual(other));
 }
コード例 #16
0
 public override bool StructurallyEquals(ZilObject obj)
 {
     return(obj is ZilAdecl other && other.First.StructurallyEquals(First) && other.Second.StructurallyEquals(Second));
 }
コード例 #17
0
 public ZilMacroResult([NotNull] ZilObject inner)
 {
     this.Inner = inner;
 }