Example #1
0
        public override bool Equals(object obj)
        {
            if (obj is AChar)
            {
                AChar other = (AChar)obj;
                return(this.asChar == other.asChar);
            }

            return(false);
        }
Example #2
0
        /// <summary>
        /// AArray generated by type and shape with Reshape dyadic nonscalar function.
        /// If shape list is null, we give back the filler elemenet.
        /// </summary>
        /// <param name="type"></param>
        /// <param name="shape"></param>
        internal static AType FillElement(ATypes type, AType shape = null)
        {
            AType filler = null;

            switch (type)
            {
            case ATypes.ABox:
            case ATypes.AFunc:
                filler = ABox.Create(ANull());
                break;

            case ATypes.AChar:
                filler = AChar.Create(' ');
                break;

            case ATypes.AFloat:
                filler = AFloat.Create(0);
                break;

            case ATypes.AInteger:
                filler = AInteger.Create(0);
                break;

            case ATypes.ASymbol:
                filler = ASymbol.Create("");
                break;

            default:
                throw new NotImplementedException("Invalid use-case");
            }

            if (shape != null)
            {
                return(AplusCore.Runtime.Function.Dyadic.DyadicFunctionInstance.Reshape.Execute(filler, shape));
            }
            else
            {
                return(filler);
            }
        }
Example #3
0
 public AType ExecutePrimitive(AChar rightArgument, AChar leftArgument)
 {
     return AInteger.Create((leftArgument != rightArgument) ? 1 : 0);
 }
Example #4
0
 public AType ExecutePrimitive(AChar rightArgument, AChar leftArgument)
 {
     int number = (leftArgument.asChar > rightArgument.asChar) ? 1 : 0;
     return AInteger.Create(number);
 }
Example #5
0
 public override AType ExecutePrimitive(AChar argument, Aplus environment = null)
 {
     return AChar.Create(argument.asChar);
 }
 public virtual AType ExecutePrimitive(AChar argument, Aplus environment = null)
 {
     throw new NotImplementedException("Invalid use-case");
 }