pike.git
/
src
/
operators.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/operators.c:2335:
*! @mixed arg1 *! @type int|float *! The result is @expr{@[arg1] - @[arg2]@}, and is a float if *! either @[arg1] or @[arg2] is a float. *! @type string *! The result is @[arg1] with all nonoverlapping occurrences of *! the substring @[arg2] removed. In cases with two overlapping *! occurrences, the leftmost is removed. *! @type array|mapping|multiset *! The result is like @[arg1] but without the elements/indices
-
*! that match any in @[arg2] (according to @[`
==
]
and
,
in the
-
*! case of mappings, @[hash_value]).
+
*! that match any in @[arg2] (according to @[`
>
]
,
@[`<]
,
@[`==]
+
*!
and, in the
case of mappings, @[hash_value]).
*! @endmixed *! The function is not destructive on the arguments - the result is *! always a new instance. *! *! @note *! In Pike 7.0 and earlier the subtraction order was unspecified. *!
-
+
*! @note
+
*! If this operator is used with arrays or multisets containing objects
+
*! which implement @[lfun::`==()] but @b{not@} @[lfun::`>()] and
+
*! @[lfun::`<()], the result will be undefined.
+
*!
*! @seealso *! @[`+()] */ PMOD_EXPORT void f_minus(INT32 args) { switch(args) { case 0: SIMPLE_WRONG_NUM_ARGS_ERROR("`-", 1); case 1: o_negate(); break; case 2: o_subtract(); break;
pike.git/src/operators.c:2716:
*! @mixed arg1 *! @type int *! Bitwise and of @[arg1] and @[arg2]. *! @type string *! The result is a string where each character is the bitwise *! and of the characters in the same position in @[arg1] and *! @[arg2]. The arguments must be strings of the same length. *! @type array|mapping|multiset *! The result is like @[arg1] but only with the *! elements/indices that match any in @[arg2] (according to
-
*! @[`==] and, in the case of mappings, @[hash_value]).
+
*! @[`
>], @[`<], @[`
==] and, in the case of mappings,
+
*!
@[hash_value]).
*! @type type|program *! Type intersection of @[arg1] and @[arg2]. *! @endmixed *! The function is not destructive on the arguments - the result is *! always a new instance. *!
-
+
*! @note
+
*! If this operator is used with arrays or multisets containing objects
+
*! which implement @[lfun::`==()] but @b{not@} @[lfun::`>()] and
+
*! @[lfun::`<()], the result will be undefined.
+
*!
*! @seealso *! @[`|()], @[lfun::`&()], @[lfun::``&()] */ PMOD_EXPORT void f_and(INT32 args) { switch(args) { case 0: SIMPLE_WRONG_NUM_ARGS_ERROR("`&", 1); case 1: return; case 2: o_and(); return;
pike.git/src/operators.c:2947:
*! @mixed arg1 *! @type int *! Bitwise or of @[arg1] and @[arg2]. *! @type string *! The result is a string where each character is the bitwise *! or of the characters in the same position in @[arg1] and *! @[arg2]. The arguments must be strings of the same length. *! @type array *! The result is an array with the elements in @[arg1] *! concatenated with those in @[arg2] that doesn't occur in
-
*! @[arg1] (according to @[`==]). The order
between the
-
*! elements that come from the same argument is kept.
+
*! @[arg1] (according to @[`
>], @[`<], @[`
==]). The order
+
*!
between the
elements that come from the same argument is kept.
*! *! Every element in @[arg1] is only matched once against an *! element in @[arg2], so if @[arg2] contains several elements *! that are equal to each other and are more than their *! counterparts in @[arg1], the rightmost remaining elements in *! @[arg2] are kept. *! @type mapping *! The result is like @[arg1] but extended with the entries *! from @[arg2]. If the same index (according to @[hash_value] *! and @[`==]) occur in both, the value from @[arg2] is used. *! @type multiset *! The result is like @[arg1] but extended with the entries in *! @[arg2] that doesn't already occur in @[arg1] (according to
-
*! @[`==]). Subsequences with orderwise equal
entries (i.e.
-
*! where @[`<] returns false) are handled just
like the array
-
*! case above.
+
*! @[`
>], @[`<] and @[`
==]). Subsequences with orderwise equal
+
*!
entries (i.e.
where @[`<] returns false) are handled just
+
*!
like the array
case above.
*! @type type|program *! Type union of @[arg1] and @[arg2]. *! @endmixed *! The function is not destructive on the arguments - the result is *! always a new instance. *!
-
+
*! @note
+
*! If this operator is used with arrays or multisets containing objects
+
*! which implement @[lfun::`==()] but @b{not@} @[lfun::`>()] and
+
*! @[lfun::`<()], the result will be undefined.
+
*!
*! @seealso *! @[`&()], @[lfun::`|()], @[lfun::``|()] */ PMOD_EXPORT void f_or(INT32 args) { switch(args) { case 0: SIMPLE_WRONG_NUM_ARGS_ERROR("`|", 1); case 1: return; case 2: o_or(); return;
pike.git/src/operators.c:3184:
*! @type int *! Bitwise exclusive or of @[arg1] and @[arg2]. *! @type string *! The result is a string where each character is the bitwise *! exclusive or of the characters in the same position in *! @[arg1] and @[arg2]. The arguments must be strings of the *! same length. *! @type array *! The result is an array with the elements in @[arg1] that *! doesn't occur in @[arg2] concatenated with those in @[arg2]
-
*! that doesn't occur in @[arg1] (according to @[`
==
]
).
The
-
*! order between the elements that come from the
same argument
-
*! is kept.
+
*! that doesn't occur in @[arg1] (according to @[`
>
]
,
@[`<] and
+
*!
@[`==]). The
order between the elements that come from the
+
*!
same argument
is kept.
*! *! Every element is only matched once against an element in the *! other array, so if one contains several elements that are *! equal to each other and are more than their counterparts in *! the other array, the rightmost remaining elements are kept. *! @type mapping *! The result is like @[arg1] but with the entries from @[arg1] *! and @[arg2] whose indices are different between them *! (according to @[hash_value] and @[`==]). *! @type multiset *! The result is like @[arg1] but with the entries from @[arg1] *! and @[arg2] that are different between them (according to
-
*! @[
hash_value
] and @[`==]). Subsequences with orderwise equal
+
*! @[
`>
]
,
@[`<]
and @[`==]). Subsequences with orderwise equal
*! entries (i.e. where @[`<] returns false) are handled just *! like the array case above. *! @type type|program *! The result is a type computed like this: *! @expr{(@[arg1]&~@[arg2])|(~@[arg1]&@[arg2])@}. *! @endmixed *! The function is not destructive on the arguments - the result is *! always a new instance. *!
-
+
*! @note
+
*! If this operator is used with arrays or multisets containing objects
+
*! which implement @[lfun::`==()] but @b{not@} @[lfun::`>()] and
+
*! @[lfun::`<()], the result will be undefined.
+
*!
*! @seealso *! @[`&()], @[`|()], @[lfun::`^()], @[lfun::``^()] */ PMOD_EXPORT void f_xor(INT32 args) { switch(args) { case 0: SIMPLE_WRONG_NUM_ARGS_ERROR("`^", 1); case 1: return; case 2: o_xor(); return;