From 749c9d4c47f1f083a9d20f028dd28744cc7c8f0c Mon Sep 17 00:00:00 2001 From: Per Hedbor <ph@opera.com> Date: Sat, 16 Aug 2014 13:37:10 +0200 Subject: [PATCH] Removed a few non-existing overloaded operators --- .../ADT.pmod/Relation.pmod/Binary.pike | 11 ----- lib/modules/ADT.pmod/Set.pike | 18 -------- src/modules/Gmp/mpf.cmod | 42 ------------------- 3 files changed, 71 deletions(-) diff --git a/lib/modules/ADT.pmod/Relation.pmod/Binary.pike b/lib/modules/ADT.pmod/Relation.pmod/Binary.pike index 7c5fad3418..f9967036ae 100644 --- a/lib/modules/ADT.pmod/Relation.pmod/Binary.pike +++ b/lib/modules/ADT.pmod/Relation.pmod/Binary.pike @@ -109,17 +109,6 @@ mixed _sizeof() return items; } -//! The expression `rel1 <= rel2' returns true if every relation entry -//! in rel1 is also present in rel2. -mixed `<=(object rel) -{ - foreach(indices(val), mixed left) - foreach(indices(val[left]), mixed right) - if (!rel(left, right)) - return 0; - return 1; -} - int(0..1) `==(mixed rel) { if (!objectp(rel) || !rel->is_binary_relation) diff --git a/lib/modules/ADT.pmod/Set.pike b/lib/modules/ADT.pmod/Set.pike index 0041db4fe1..4bf910458d 100644 --- a/lib/modules/ADT.pmod/Set.pike +++ b/lib/modules/ADT.pmod/Set.pike @@ -113,7 +113,6 @@ this_program filter_destructively(function f) /// OPERATORS /// ///////////////// - //! Subset. A <= B returns true if all items in A are also present in B. int(0..1) subset(ADT.Set other) { @@ -124,7 +123,6 @@ int(0..1) subset(ADT.Set other) return 1; } - //! Superset. A >= B returns true if all items in B are also present in A. int(0..1) superset(ADT.Set other) { @@ -169,22 +167,6 @@ int(0..1) `>(ADT.Set other) return superset(other); } - -//! Subset operator. -function `<= = subset; - - -//! Superset operator. -function `>= = superset; - - -//! Inequality. A != B is equivalent to !(A == B). -int(0..1) `!=(ADT.Set other) -{ - return !(this == other); -} - - //! Union. Returns a set containing all elements present in either //! or both of the operand sets. this_program `|(ADT.Set other) diff --git a/src/modules/Gmp/mpf.cmod b/src/modules/Gmp/mpf.cmod index 2ff74a7a55..678d89f323 100644 --- a/src/modules/Gmp/mpf.cmod +++ b/src/modules/Gmp/mpf.cmod @@ -626,20 +626,6 @@ PIKECLASS mpf RETURN res; } - /*! @decl static Gmp.mpf `*=(int|float|object ... a) - */ - PIKEFUN object `*=(int|float|object ... UNUSED) - flags ID_PROTECTED; - { - unsigned long int prec; - prec=add_convert_args(args); - - if(prec > mpf_get_prec(THISMPF)) - mpf_set_prec(THISMPF, prec); - - mult_args(THISMPF, args); - REF_RETURN fp->current_object; - } static void sub_args(MP_FLT *res, INT32 args) @@ -789,22 +775,6 @@ PIKECLASS mpf RETURN CMPOP(<); } - /*! @decl static int(0..1) `>=(mixed q) - */ - PIKEFUN int(0..1) `>=(mixed q) - flags ID_PROTECTED; - { - RETURN CMPOP(>=); - } - - /*! @decl static int(0..1) `<=(mixed q) - */ - PIKEFUN int(0..1) `<=(mixed q) - flags ID_PROTECTED; - { - RETURN CMPOP(<=); - } - /*! @decl static int(0..1) `==(mixed q) */ @@ -819,18 +789,6 @@ PIKECLASS mpf RETURN (arg && !mpf_cmp(THISMPF, arg)); } - /*! @decl static int(0..1) `!=(mixed q) - */ - PIKEFUN int `!=(mixed q) - flags ID_PROTECTED; - { - MP_FLT *arg; - if(TYPEOF(*q) == T_INT && TOOBIGTEST(0)) - RETURN mpf_cmp_si(THISMPF, q->u.integer) != 0; - arg=get_mpf(q, 0, 0); - RETURN (!arg || mpf_cmp(THISMPF, arg)); - } - /*! @decl int sgn() */ PIKEFUN int sgn() -- GitLab