예제 #1
0
 public LithpPrimitive Cast(LithpType newType)
 {
     if (newType == LithpType())
     {
         return(this);
     }
     return(cast(newType));
 }
예제 #2
0
        protected override LithpPrimitive cast(LithpType newType)
        {
            switch (newType)
            {
            case LithpBlunt.LithpType.STRING:
                return(value.ToString());

            case LithpBlunt.LithpType.INTEGER:
                return(new LithpInteger(Convert.ToInt64(value)));

            default:
                throw new NotImplementedException();
            }
        }
예제 #3
0
        protected override LithpPrimitive cast(LithpType newType)
        {
            switch (newType)
            {
            case LithpBlunt.LithpType.STRING:
                return(value.ToString());

            case LithpBlunt.LithpType.FLOAT:
                return(new LithpFloat(value.ToString()));

            default:
                throw new NotImplementedException();
            }
        }
예제 #4
0
        protected override LithpPrimitive cast(LithpType newType)
        {
            switch (newType)
            {
            case LithpBlunt.LithpType.INTEGER:
                return(new LithpInteger(Value));

            case LithpBlunt.LithpType.FLOAT:
                return(new LithpFloat(Value));

            case LithpBlunt.LithpType.ATOM:
                return(LithpAtom.Atom(Value));

            default:
                throw new NotImplementedException();
            }
        }
예제 #5
0
        protected override LithpPrimitive cast(LithpType newType)
        {
            switch (newType)
            {
            case LithpBlunt.LithpType.STRING:
                return(Name);

            case LithpBlunt.LithpType.INTEGER:
                return(Id);

            case LithpBlunt.LithpType.FLOAT:
                return(new LithpFloat((double)Id));

            default:
                throw new NotImplementedException();
            }
        }
예제 #6
0
 protected virtual LithpPrimitive cast(LithpType newType)
 {
     throw new NotImplementedException();
 }