Strings expressions

  1. string: should be blank
  2. string:hello should be a greeting
  3. string:help my $aString should be xxx
  4. string:www.${aString}.org should be are like
  5. string:give me $$${aString} or else should be a threat!
  6. string:user is ${user/name} should be user is a name
  7. string:user is $user/name should be user is a name

Exists expressions

  1. exists: doggy should be true = not false
  2. not: exists: doggy should be false = not true
  3. exists: aString should be true = not false
  4. exists: user/name should be true = not false
  5. exists: non/existing/path should be false = not true
  6. exists: user/isAMan should be true = not false
  7. exists: user/isAWoman should be true = not false
  8. exists: user/isADog should be false = not true
  9. exists: user/undefValue should be false = not true

Not expressions

  1. 0 should be 0 = not true
  2. not:0 should be true = not false
  3. 1 should be 1 = not true
  4. not:1 should be false = not true
  5. false should be false = not false
  6. not:false should be true = not false
  7. true should be true = not true
  8. not:true should be false = not true
  9. doggy should be false = not false
  10. not:doggy should be true = not false

Javascript expressions

  1. js: 5 + 4 = 9 = 5 + 4
  2. js: 5 - 4 = 1 = 5 - 4
  3. js: 5 * 4 = 20 = 5 * 4
  4. js: 69 / 3 = 23 = 69 / 3
  5. js: 23 % 7 = 2 = 23 % 7
  6. js: 1 > 0 ? true : false = true = not false
  7. js: 1 > 0 = true = not false
  8. js: 1 < 0 = false = not true
  9. js: ${number100} + 1 = 101 = 100 + 1

Comparison expressions

  1. eq: 12 12 = true = not false
  2. eq: 12 11 = true = not true
  3. eq: 1 1 = true = not false
  4. eq: 0 1 = false = not true
  5. eq: number1 number100 = false = not true
  6. eq: number1 otherNumber1 = true = not false
  7. eq: true true = true = not false
  8. eq: (not: false) true = true = not false
  9. gt: 1 0 = true = not false
  10. gt: 1 1 = false = not true
  11. gt: 0 1 = false = not true
  12. gt: number1 number100 = false = not true
  13. gt: number100 number1 = true = not false
  14. lt: 1 0 = false = not true
  15. lt: 1 1 = false = not true
  16. lt: 0 1 = true = not false
  17. lt: number1 number100 = true = not false
  18. lt: number100 number1 = false = not true
  19. eq: (+: 1 3) (*: 2 2) = true = not false
  20. not: eq: (+: 1 3) (*: 2 2) = false = not true
  21. not: eq: ( +: 1 3 ) ( *: 2 2 ) = false = not true
  22. in: 1 1 = true = not false
  23. in: 1 2 = false = not true
  24. in: 1 0 1 = true = not false
  25. in: 1 0 2 = false = not true
  26. in: number1 0 number1 = true = not false
  27. in: number1 0 number100 = false = not true
  28. in: number1 0 [number1 number100] = true = not false
  29. in: number1 0 [2 number100] = false = not true
  30. in: 'b' 'a' 'b' 'c' = true = not false
  31. in: 'z' 'a' 'b' 'c' = false = not true

Math expressions

  1. +: 5 4 = 9 = 5 + 4
  2. -: 5 4 = 1 = 5 - 4
  3. *: 5 4 = 20 = 5 * 4
  4. /: 69 3 = 23 = 69 / 3
  5. %: 23 7 = 2 = 23 % 7
  6. +: number100 1 = 101 = 100 + 1
  7. *: 2 ( +: number100 1 ) = 202 = 2 * (100 + 1)

Boolean expressions

  1. and: true true true = true = not false
  2. and: false true true = false = not true
  3. and: true false true = false = not true
  4. or: true false false = true = not false
  5. or: false true false = true = not false
  6. or: false false false = false = not true
  7. cond: true 1 2 = 1 = a number
  8. cond: true (cond: false 'rock' 'tree') 'primate' = tree = shrub
  9. cond: false (cond: false 'rock' 'tree') (cond: false 'rock2' 'tree2') = tree2 = shrub
  10. cond: (cond: false true false) (cond: false 'rock' 'tree') (cond: false 'rock2' 'tree2') = tree2 = shrub
  11. cond: true 'literal with spaces 1' 'literal with spaces 2' = literal with spaces 1 = test literal with spaces
  12. cond: true ( cond: false 'a' 'literal with spaces 1' ) 'literal with spaces 2' = literal with spaces 1 = test literal with spaces

Path expressions

  1. user/name | string:no friends = Bob = any friends?
  2. nullValue | string:no enemies = no enemies = any enemies?
  3. non/existing/path | string:no enemies = no enemies = any enemies?
  4. nullValue | non/existing/path | string:no enemies = no enemies = any enemies?
  5. nullValue | user/name | string:no enemies = no enemies = any enemies?
  6. user/name | non/existing/path | string:no enemies = no enemies = any enemies?
  7. non/existing | non/existing/path | string:no enemies = no enemies = any enemies?

Literal expressions (string, numeric and boolean)

  1. 'this is a string literal' should be the literal
  2. 123 should be an integer
  3. 123.45 should be a float
  4. true should be not false
  5. false should be not true

Function calls

  1. function3() = 3 = 3
  2. divBy0() = Infinity = 1 / 0
  3. add( 1, 2 ) = 3 = 1 + 2
  4. add( 1, number100 ) = 101 = 1 + number100
  5. add( 1, (*: 2 2 ) ) = 5 = 1 + 2*2

Arrays

  1. items[0] = item0 = an item
  2. items[1] = item1 = an item
  3. items[2] = item2 = an item
  4. items = item0, item1, item2 = the items
  5. +: from1To3 = 6 = 1 + 2 + 3
  6. +: from1To3 4 = 10 = 1 + 2 + 3 + 4
  7. [1 2 3] = 1,2,3 = from 1 to 3
  8. [1 2 3 number1] = 1,2,3,1 = from 1 to 3 and 1
  9. +: [number1 1:3] = 1+1+2+3 = 7 = 1 + 1 to 3

Methods

  1. user/age() = 25 = user/age()
  2. user/add1Method( 10 ) = 11 = user/add1Method( 10 )
  3. user/addMethod( 1, 2 ) = 3 = user/addMethod( 1, 2 )

Default expressions (variable names and object access using '/')

  1. aString = string = a string
  2. user/name = Bob = user/name

Some complex paths

  1. user/birth()/year = 1977 = a year
  2. user/birth()/aFunction()/another = yes! = don't say no!
  3. user/birth()/aFunction()/another/length = 4 = yes! length

Maps

  1. items[index] (index = 0) = item0 = an item
  2. user[index] (index = 'name') = Bob = must be Bob
  3. user['name'] = Bob = must be Bob

Window object

  1. window/globalVar = 'It works!' = a string

Context object

  1. context/getConf()/contextVarName = 'context' = a string

Nocall expressions

  1. run() = 10 = must be 10
  2. run() = 11 = must be 11

Indirection

  1. items/?index (index = 0) = item0 = an item
  2. user/?index (index = 'name') = Bob = must be Bob