author | Myhailo Danylenko <isbear@ukrpost.net> |
Tue, 10 Nov 2009 19:36:54 +0200 | |
changeset 1 | 320e4393785a |
parent 0 | 7707b26e82fd |
child 4 | faaed3ae3fa8 |
permissions | -rw-r--r-- |
0 | 1 |
|
2 |
/EVAL [expression] |
|
3 |
||
4 |
Evaluates expression and executes result string as command. |
|
5 |
Expression evaluation rules: |
|
6 |
* all operators have the same precedence; |
|
7 |
* supported operators: |
|
8 |
. string concatenation |
|
9 |
+ binary plus / string concatenation |
|
10 |
- binary minus |
|
11 |
* multiplication / string replication |
|
12 |
/ division |
|
13 |
% division remain |
|
14 |
< binary / string less than |
|
15 |
> binary / string greater than |
|
16 |
= binary / string equality |
|
17 |
* strings must be quoted with double quotes ("..."), within string backslash is used for character escaping (\\ and \" are only useful applications); |
|
18 |
* parentheses can be used to change operators precedence, nested parentheses are supported as long as they are balanced; |
|
19 |
* numbers can be specified as plain decimal numbers, minus in front of digit will be recognized as a part of number; |
|
20 |
* mcabber variables can be specified by name, though only subset of possible names is suppoted: |
|
21 |
- variable must start from latin alphabetic symbol; |
|
1
320e4393785a
Parentheses now have no restrictions in strings
Myhailo Danylenko <isbear@ukrpost.net>
parents:
0
diff
changeset
|
22 |
- inside of variable name also are allowed digits, - and _; |
320e4393785a
Parentheses now have no restrictions in strings
Myhailo Danylenko <isbear@ukrpost.net>
parents:
0
diff
changeset
|
23 |
* to enable parentheses in character strings current implementation ignores anything after extra closing paren - you may use this as a sort of comment... |
0 | 24 |
|
25 |
Example: |
|
26 |
/eval "echo 2 + 2 = " . (2+2) |
|
1
320e4393785a
Parentheses now have no restrictions in strings
Myhailo Danylenko <isbear@ukrpost.net>
parents:
0
diff
changeset
|
27 |
/eval "set ping_interval = " . (ping_interval + 1) ) this example probably should use /let command. |