Strings expressions
- string: should be blank
- string:hello should be a greeting
- string:help my $aString should be xxx
- string:www.${aString}.org should be are like
- string:give me $$${aString} or else should be a threat!
- string:user is ${user/name} should be user is a name
- string:user is $user/name should be user is a name
Exists expressions
- exists: doggy should be true = not false
- not: exists: doggy should be false = not true
- exists: aString should be true = not false
- exists: user/name should be true = not false
- exists: non/existing/path should be false = not true
- exists: user/isAMan should be true = not false
- exists: user/isAWoman should be true = not false
- exists: user/isADog should be false = not true
- exists: user/undefValue should be false = not true
Not expressions
- 0 should be 0 = not true
- not:0 should be true = not false
- 1 should be 1 = not true
- not:1 should be false = not true
- false should be false = not false
- not:false should be true = not false
- true should be true = not true
- not:true should be false = not true
- doggy should be false = not false
- not:doggy should be true = not false
Javascript expressions
- js: 5 + 4 = 9 = 5 + 4
- js: 5 - 4 = 1 = 5 - 4
- js: 5 * 4 = 20 = 5 * 4
- js: 69 / 3 = 23 = 69 / 3
- js: 23 % 7 = 2 = 23 % 7
- js: 1 > 0 ? true : false = true = not false
- js: 1 > 0 = true = not false
- js: 1 < 0 = false = not true
- js: ${number100} + 1 = 101 = 100 + 1
Comparison expressions
- eq: 12 12 = true = not false
- eq: 12 11 = true = not true
- eq: 1 1 = true = not false
- eq: 0 1 = false = not true
- eq: number1 number100 = false = not true
- eq: number1 otherNumber1 = true = not false
- eq: true true = true = not false
- eq: (not: false) true = true = not false
- gt: 1 0 = true = not false
- gt: 1 1 = false = not true
- gt: 0 1 = false = not true
- gt: number1 number100 = false = not true
- gt: number100 number1 = true = not false
- lt: 1 0 = false = not true
- lt: 1 1 = false = not true
- lt: 0 1 = true = not false
- lt: number1 number100 = true = not false
- lt: number100 number1 = false = not true
- eq: (+: 1 3) (*: 2 2) = true = not false
- not: eq: (+: 1 3) (*: 2 2) = false = not true
- not: eq: ( +: 1 3 ) ( *: 2 2 ) = false = not true
- in: 1 1 = true = not false
- in: 1 2 = false = not true
- in: 1 0 1 = true = not false
- in: 1 0 2 = false = not true
- in: number1 0 number1 = true = not false
- in: number1 0 number100 = false = not true
- in: number1 0 [number1 number100] = true = not false
- in: number1 0 [2 number100] = false = not true
- in: 'b' 'a' 'b' 'c' = true = not false
- in: 'z' 'a' 'b' 'c' = false = not true
Math expressions
- +: 5 4 = 9 = 5 + 4
- -: 5 4 = 1 = 5 - 4
- *: 5 4 = 20 = 5 * 4
- /: 69 3 = 23 = 69 / 3
- %: 23 7 = 2 = 23 % 7
- +: number100 1 = 101 = 100 + 1
- *: 2 ( +: number100 1 ) = 202 = 2 * (100 + 1)
Boolean expressions
- and: true true true = true = not false
- and: false true true = false = not true
- and: true false true = false = not true
- or: true false false = true = not false
- or: false true false = true = not false
- or: false false false = false = not true
- cond: true 1 2 = 1 = a number
- cond: true (cond: false 'rock' 'tree') 'primate' = tree = shrub
- cond: false (cond: false 'rock' 'tree') (cond: false 'rock2' 'tree2') = tree2 = shrub
- cond: (cond: false true false) (cond: false 'rock' 'tree') (cond: false 'rock2' 'tree2') = tree2 = shrub
- cond: true 'literal with spaces 1' 'literal with spaces 2' = literal with spaces 1 = test literal with spaces
- cond: true ( cond: false 'a' 'literal with spaces 1' ) 'literal with spaces 2' = literal with spaces 1 = test literal with spaces
Path expressions
- user/name | string:no friends = Bob = any friends?
- nullValue | string:no enemies = no enemies = any enemies?
- non/existing/path | string:no enemies = no enemies = any enemies?
- nullValue | non/existing/path | string:no enemies = no enemies = any enemies?
- nullValue | user/name | string:no enemies = no enemies = any enemies?
- user/name | non/existing/path | string:no enemies = no enemies = any enemies?
- non/existing | non/existing/path | string:no enemies = no enemies = any enemies?
Literal expressions (string, numeric and boolean)
- 'this is a string literal' should be the literal
- 123 should be an integer
- 123.45 should be a float
- true should be not false
- false should be not true
Function calls
- function3() = 3 = 3
- divBy0() = Infinity = 1 / 0
- add( 1, 2 ) = 3 = 1 + 2
- add( 1, number100 ) = 101 = 1 + number100
- add( 1, (*: 2 2 ) ) = 5 = 1 + 2*2
Arrays
- items[0] = item0 = an item
- items[1] = item1 = an item
- items[2] = item2 = an item
- items = item0, item1, item2 = the items
- +: from1To3 = 6 = 1 + 2 + 3
- +: from1To3 4 = 10 = 1 + 2 + 3 + 4
- [1 2 3] = 1,2,3 = from 1 to 3
- [1 2 3 number1] = 1,2,3,1 = from 1 to 3 and 1
- +: [number1 1:3] = 1+1+2+3 = 7 = 1 + 1 to 3
Methods
- user/age() = 25 = user/age()
- user/add1Method( 10 ) = 11 = user/add1Method( 10 )
- user/addMethod( 1, 2 ) = 3 = user/addMethod( 1, 2 )
Default expressions (variable names and object access using '/')
- aString = string = a string
- user/name = Bob = user/name
Some complex paths
- user/birth()/year = 1977 = a year
- user/birth()/aFunction()/another = yes! = don't say no!
- user/birth()/aFunction()/another/length = 4 = yes! length
Maps
- items[index] (index = 0) = item0 = an item
- user[index] (index = 'name') = Bob = must be Bob
- user['name'] = Bob = must be Bob
Window object
- window/globalVar = 'It works!' = a string
Context object
- context/getConf()/contextVarName = 'context' = a string
Nocall expressions
- run() = 10 = must be 10
- run() = 11 = must be 11
Indirection
- items/?index (index = 0) = item0 = an item
- user/?index (index = 'name') = Bob = must be Bob