Branch: Tag:

2004-11-27

2004-11-27 22:48:11 by Martin Stjernholm <mast@lysator.liu.se>

Removed assumptions that inequality operations always works on total orders
(that's not even true for simple floats). I.e. that a <= b is the same as
!(a > b) and so on.

Rev: src/interpret_functions.h:1.177
Rev: src/operators.c:1.201
Rev: src/operators.h:1.17
Rev: src/peep.in:1.76
Rev: src/svalue.c:1.207
Rev: src/svalue.h:1.133
Rev: src/treeopt.in:1.76

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: operators.c,v 1.200 2004/11/26 14:17:04 nilsson Exp $ + || $Id: operators.c,v 1.201 2004/11/27 22:48:11 mast Exp $   */      #include "global.h"
1011:    *! @expr{predef::`<=(a,b)@}.    *!    *! @returns -  *! Returns @expr{1@} if the arguments are not strictly decreasing, and -  *! @expr{0@} (zero) otherwise. +  *! Returns @expr{1@} if the test is successful, @expr{0@} +  *! otherwise.    *! -  *! This is the inverse of @[`>()]. +  *! @note +  *! For total orders, e.g. integers, this is the inverse of @[`>()].    *!    *! @seealso    *! @[`<()], @[`>()], @[`>=()]    */ - COMPARISON(f_le,"`<=",!is_gt) + COMPARISON(f_le,"`<=",is_le)      /*! @decl int(0..1) `>(mixed arg1, mixed arg2, mixed ... extras)    *!
1047:    *! @expr{predef::`>=(a,b)@}.    *!    *! @returns -  *! Returns @expr{1@} if the arguments are not strictly increasing, and -  *! @expr{0@} (zero) otherwise. +  *! Returns @expr{1@} if the test is successful, @expr{0@} +  *! otherwise.    *! -  *! This is the inverse of @[`<()]. +  *! @note +  *! For total orders, e.g. integers, this is the inverse of @[`<()].    *!    *! @seealso    *! @[`<=()], @[`>()], @[`<()]    */ - COMPARISON(f_ge,"`>=",!is_lt) + COMPARISON(f_ge,"`>=",is_ge)         #define CALL_OPERATOR(OP, args) do { \
1719:       TMP_OPT(f_eq, "`!=");    TMP_OPT(f_ne, "`=="); + #if 0 +  /* The following only work on total orders. We can't assume that. */    TMP_OPT(f_lt, "`>=");    TMP_OPT(f_gt, "`<=");    TMP_OPT(f_le, "`>");    TMP_OPT(f_ge, "`<"); -  + #endif   #undef TMP_OPT    if((more_args = is_call_to(*first_arg, f_search)) &&    (count_args(*more_args) == 2)) {