Otp.Erlang.List.arity C# (CSharp) Méthode

arity() public méthode

public arity ( ) : int
Résultat int
        public virtual int arity()
        {
            if (elems == null)
                return 0;
            else
                return elems.Length;
        }

Usage Example

Exemple #1
0
        /*
         * Determine if two lists are equal. Lists are equal if they have
         * the same arity and all of the elements are equal.
         *
         * @param o the list to compare to.
         *
         * @return true if the lists have the same arity and all the
         * elements are equal.
         **/
        public override bool Equals(System.Object o)
        {
            if (!(o is List))
            {
                return(false);
            }

            List l = (List)o;
            int  a = this.arity();

            if (a != l.arity())
            {
                return(false);
            }

            for (int i = 0; i < a; i++)
            {
                if (!this.elems[i].Equals(l.elems[i]))
                {
                    return(false);
                }
                // early exit
            }

            return(true);
        }
All Usage Examples Of Otp.Erlang.List::arity