Exemple #1
0
        private static LpObject eq(LpObject self, LpObject[] args, LpObject block = null)
        {
            var o   = args[0];
            var sym = symbols[o.stringValue];

            return(LpBool.initialize(self == sym));
        }
Exemple #2
0
        private static LpObject between(LpObject self, LpObject[] args, LpObject block = null)
        {
            var v1  = args[0].doubleValue;
            var v2  = args[1].doubleValue;
            var v   = self.doubleValue;
            var max = (v1 < v2) ? v2 : v1;
            var min = (v1 < v2) ? v1 : v2;

            return(LpBool.initialize(min <= v && v <= max));
        }
Exemple #3
0
        protected static LpObject to_bool(LpObject self, LpObject[] args, LpObject block = null)
        {
            if (self.class_name == "Nl")
            {
                return(LpBool.initialize(false));
            }
            if (self.class_name == "Bool")
            {
                return(LpBool.initialize((bool)self.boolValue));
            }

            return(LpBool.initialize(true));
        }
Exemple #4
0
        protected static LpObject is_a(LpObject self, LpObject[] args, LpObject block = null)
        {
            if (self.class_name == args[0].class_name)
            {
                return(LpBool.initialize(true));
            }

            if (null != self.superclass)
            {
                return(self.superclass.funcall("is_a?", args, block));
            }

            return(LpBool.initialize(false));
        }
Exemple #5
0
 protected static LpObject is_nil(LpObject self, LpObject[] args, LpObject block = null)
 {
     return(LpBool.initialize(false));
 }
Exemple #6
0
        private static LpObject eq(LpObject self, LpObject[] args, LpObject block = null)
        {
            var o = args[0];

            return(LpBool.initialize(o.GetHashCode() == o.GetHashCode()));
        }
Exemple #7
0
        private static LpObject eq(LpObject self, LpObject[] args, LpObject block = null)
        {
            var o = args[0];

            return(LpBool.initialize(self.doubleValue == o.doubleValue));
        }
Exemple #8
0
        private static LpObject compareToLowerEqual(LpObject self, LpObject[] args, LpObject block = null)
        {
            var o = args[0];

            return(LpBool.initialize(self.doubleValue <= o.doubleValue));
        }
Exemple #9
0
        protected static LpObject equal(LpObject self, LpObject[] args, LpObject block = null)
        {
            var v = args.First();

            return(LpBool.initialize(v.class_name == self.class_name));
        }
Exemple #10
0
        private static LpObject orOp(LpObject self, LpObject[] args, LpObject block = null)
        {
            var o = args[0];

            return(LpBool.initialize((bool)self.boolValue || (bool)o.boolValue));
        }
Exemple #11
0
        private static LpObject equal(LpObject self, LpObject[] args, LpObject block = null)
        {
            var o = args[0];

            return(LpBool.initialize(self.stringValue == o.stringValue));
        }