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)); }
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)); }
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)); }
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)); }
protected static LpObject is_nil(LpObject self, LpObject[] args, LpObject block = null) { return(LpBool.initialize(false)); }
private static LpObject eq(LpObject self, LpObject[] args, LpObject block = null) { var o = args[0]; return(LpBool.initialize(o.GetHashCode() == o.GetHashCode())); }
private static LpObject eq(LpObject self, LpObject[] args, LpObject block = null) { var o = args[0]; return(LpBool.initialize(self.doubleValue == o.doubleValue)); }
private static LpObject compareToLowerEqual(LpObject self, LpObject[] args, LpObject block = null) { var o = args[0]; return(LpBool.initialize(self.doubleValue <= o.doubleValue)); }
protected static LpObject equal(LpObject self, LpObject[] args, LpObject block = null) { var v = args.First(); return(LpBool.initialize(v.class_name == self.class_name)); }
private static LpObject orOp(LpObject self, LpObject[] args, LpObject block = null) { var o = args[0]; return(LpBool.initialize((bool)self.boolValue || (bool)o.boolValue)); }
private static LpObject equal(LpObject self, LpObject[] args, LpObject block = null) { var o = args[0]; return(LpBool.initialize(self.stringValue == o.stringValue)); }