Exemplo n.º 1
0
        public override AType Execute(AType argument, Aplus environment = null)
        {
            // Scalar can not be sorted
            if (argument.Rank < 1)
            {
                throw new Error.Rank(RankErrorText);
            }

            // Likewise box array
            if (argument.IsBox)
            {
                throw new Error.Type(TypeErrorText);
            }

            return argument.InsertionSortIndex((a, b) => { return a.CompareTo(b); });
        }
Exemplo n.º 2
0
        public override AType Execute(AType argument, Aplus environment = null)
        {
            // Scalar can not be sorted
            if (argument.Rank < 1)
            {
                throw new Error.Rank(RankErrorText);
            }

            // Likewise box array
            if (argument.IsBox)
            {
                throw new Error.Type(TypeErrorText);
            }

            return(argument.InsertionSortIndex((a, b) => { return -a.CompareTo(b); }));
        }