Exemplo n.º 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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
        public override AType Execute(AType argument, Aplus environment)
        {
            AType result;

            if (argument.SimpleArray())
            {
                result = SimpleCase(argument);
            }
            else
            {
                result = NestedCase(argument);
            }

            return(result);
        }
Exemplo n.º 4
0
        public override AType Execute(AType argument, Aplus environment)
        {
            AType result;

            if (argument.SimpleArray())
            {
                result = SimpleCase(argument);
            }
            else
            {
                result = NestedCase(argument);
            }

            return result;
        }
Exemplo n.º 5
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);
            }
        }
Exemplo n.º 6
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));
            }
        }