author | Myhailo Danylenko <isbear@ukrpost.net> |
Fri, 17 Aug 2012 19:09:08 +0300 | |
changeset 29 | 5d86c5fefef6 |
parent 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 |
|
4
faaed3ae3fa8
String head and tail operators
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
9 |
: string head |
faaed3ae3fa8
String head and tail operators
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
10 |
^ string tail |
0 | 11 |
+ binary plus / string concatenation |
12 |
- binary minus |
|
13 |
* multiplication / string replication |
|
14 |
/ division |
|
15 |
% division remain |
|
16 |
< binary / string less than |
|
17 |
> binary / string greater than |
|
18 |
= binary / string equality |
|
19 |
* strings must be quoted with double quotes ("..."), within string backslash is used for character escaping (\\ and \" are only useful applications); |
|
20 |
* parentheses can be used to change operators precedence, nested parentheses are supported as long as they are balanced; |
|
21 |
* numbers can be specified as plain decimal numbers, minus in front of digit will be recognized as a part of number; |
|
22 |
* mcabber variables can be specified by name, though only subset of possible names is suppoted: |
|
23 |
- 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
|
24 |
- 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
|
25 |
* to enable parentheses in character strings current implementation ignores anything after extra closing paren - you may use this as a sort of comment... |
0 | 26 |
|
27 |
Example: |
|
28 |
/eval "echo 2 + 2 = " . (2+2) |
|
1
320e4393785a
Parentheses now have no restrictions in strings
Myhailo Danylenko <isbear@ukrpost.net>
parents:
0
diff
changeset
|
29 |
/eval "set ping_interval = " . (ping_interval + 1) ) this example probably should use /let command. |
4
faaed3ae3fa8
String head and tail operators
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
30 |
/eval "echo " . (ssl_fingerprint : 5) . "..." . (ssl_fingerprint ^ 5) ) negative offsets are also supported |