Example #1
0
 public LithpPrimitive Cast(LithpType newType)
 {
     if (newType == LithpType())
     {
         return(this);
     }
     return(cast(newType));
 }
Example #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();
            }
        }
Example #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();
            }
        }
Example #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();
            }
        }
Example #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();
            }
        }
Example #6
0
 protected virtual LithpPrimitive cast(LithpType newType)
 {
     throw new NotImplementedException();
 }