Exemple #1
0
        public override AType Execute(AType argument, Aplus environment)
        {
            AType result;

            if (argument.SimpleArray())
            {
                result = argument.IsMemoryMappedFile ? argument : argument.Clone();
            }
            else
            {
                if (!argument.NestedArray())
                {
                    throw new Error.Domain(DomainErrorText);
                }

                switch (argument.Rank)
                {
                    case 0:
                        result = MonadicFunctionInstance.Disclose.Execute(argument);
                        break;
                    case 1:
                        result = NestedVector(argument);
                        break;
                    default:
                        throw new Error.Rank(RankErrorText);
                }
            }

            return result;
        }
Exemple #2
0
        public override AType Execute(AType argument, Aplus environment)
        {
            AType result;

            if (argument.SimpleArray())
            {
                result = argument.IsMemoryMappedFile ? argument : argument.Clone();
            }
            else
            {
                if (!argument.NestedArray())
                {
                    throw new Error.Domain(DomainErrorText);
                }

                switch (argument.Rank)
                {
                case 0:
                    result = MonadicFunctionInstance.Disclose.Execute(argument);
                    break;

                case 1:
                    result = NestedVector(argument);
                    break;

                default:
                    throw new Error.Rank(RankErrorText);
                }
            }

            return(result);
        }
Exemple #3
0
        public override AType Execute(AType argument, Aplus environment = null)
        {
            if (argument.SimpleArray())
            {
                //The argument is simple array/scalar and not mapped we clone it! 
                return argument.IsMemoryMappedFile ?
                    argument :
                    argument.Clone();
            }
            else
            {
                if (!argument.NestedArray())
                {
                    throw new Error.Domain(DomainErrorText);
                }

                return DiscloseNestedArray(argument, environment);
            }
        }
Exemple #4
0
        public override AType Execute(AType argument, Aplus environment = null)
        {
            if (argument.SimpleArray())
            {
                //The argument is simple array/scalar and not mapped we clone it!
                return(argument.IsMemoryMappedFile ?
                       argument :
                       argument.Clone());
            }
            else
            {
                if (!argument.NestedArray())
                {
                    throw new Error.Domain(DomainErrorText);
                }

                return(DiscloseNestedArray(argument, environment));
            }
        }