sub-string = string-expr "[" integer-expr ":" integer-expr "]"
@@ -1221,10 +1221,10 @@ dev-expr -- Expressions calculator v1.10.0Currently, boolean operations are evaluated using short cut evaluation. This means that, if the left expression of the and
and or
operators is sufficient to establish the result of the whole operation, the right expression would not evaluated at all.
Currently, boolean operations are evaluated using short cut evaluation. This means that, if the left expression of the and
and or
operators is sufficient to establish the result of the whole operation, the right expression would not be evaluated at all.
+.Example
2 > (a=1) or (a=8) > 0; a (1)
+ + | +
+dev-expr provides the ctrl() function that allows to change this behaviour.
+ |
+
>>>
[1,2,3]
// List of integers
-[1, 2, 3]
+[1, 2, 3]
>>>
["one", "two", "three"]
// List of strings
-["one", "two", "three"]
+["one", "two", "three"]
>>>
["one", 2, false, 4.1]
// List of mixed-types
-["one", 2, false, 4.1]
+["one", 2, false, 4.1]
>>>
["one"+1, 2.0*(9-2)]
// List of expressions
-["one1", 14]
+["one1", 14]
>>>
[ [1,"one"], [2,"two"]]
// List of lists
[[1, "one"], [2, "two"]]
[1,2] << 3
→ [1,2,3]
.
List item
[]
Item at index
Item at given position
[1,2.3].1
→ 2
[1,2,3][1]
→ 2
in
The items of array can be accessed using the dot .
operator.
Array’s items can be accessed using the index []
operator.
item = list-expr "." integer-expr
+item = list-expr "[" integer-expr "]"
+slice = string-expr "[" integer-expr ":" integer-expr "]"
>>>
[1,2,3].1
-2
+2
>>>
list=[1,2,3]; list.1
-2
+2
>>>
["one","two","three"].1
-two
+two
>>>
list=["one","two","three"]; list.(2-1)
-two
+two
>>>
list.(-1)
-three
+three
>>>
list.(10)
-Eval Error: [1:9] index 10 out of bounds
+Eval Error: [1:9] index 10 out of bounds
>>>
#list
-3
+3
>>>
index=2; ["a", "b", "c", "d"].index
c
dict = empty-dict | non-empty-dict variable = identifier "=" any-value
@@ -1432,7 +1452,7 @@ dev-expr -- Expressions calculator v1.10.0
-
@@ -1953,7 +1973,7 @@ These operators have a high priority, in particular higher than the operator