Enter context expression (or {} for an empty context):
Now enter expressions:
expression: 10
value:      10

expression: 3847.58
value:      3847.58

expression: 0.5
value:      0.5

expression: 10
value:      10

expression: 987
value:      987

expression: 12347812309487
value:      12347812309487

expression: "hello"
value:      "hello"

expression: "goodbye\n"
value:      "goodbye\n"

expression: "\"quotes\""
value:      "\"quotes\""

expression: "tab\ttab\ttab\rreturn\nnewline\n"
value:      "tab\ttab\ttab\rreturn\nnewline\n"

expression: "\\\\\\\\"
value:      "\\\\\\\\"

expression: true
value:      true

expression: false
value:      false

expression: null
value:      null

expression: true and true
value:      true

expression: true and true
value:      true

expression: true and false
value:      false

expression: true and false
value:      false

expression: false and true
value:      false

expression: false and true
value:      false

expression: false and false
value:      false

expression: false and false
value:      false

expression: true or true
value:      true

expression: true or true
value:      true

expression: true or false
value:      true

expression: true or false
value:      true

expression: false or true
value:      true

expression: false or true
value:      true

expression: false or false
value:      false

expression: false or false
value:      false

expression:  not true
value:      false

expression:  not true
value:      false

expression:  not false
value:      true

expression: 10==20
value:      false

expression: 10!=20
value:      true

expression: 10<20
value:      true

expression: 10<=20
value:      true

expression: 10>20
value:      false

expression: 10>=20
value:      false

expression: 10.5==20.5
value:      false

expression: 10.5!=20.5
value:      true

expression: 10.5<20.5
value:      true

expression: 10.5<=20.5
value:      true

expression: 10.5>20.5
value:      false

expression: 10.5>=20.5
value:      false

expression: "hello"=="goodbye"
value:      false

expression: "hello"!="goodbye"
value:      true

expression: "hello"<="goodbye"
value:      false

expression: "hello"<"goodbye"
value:      false

expression: "hello">"goodbye"
value:      true

expression: "hello">="goodbye"
value:      true

expression: "hello"=="hello"
value:      true

expression: "hello"!="hello"
value:      false

expression: "hello"<="hello"
value:      true

expression: "hello"<"hello"
value:      false

expression: "hello">"hello"
value:      false

expression: "hello">="hello"
value:      true

expression: a==b
value:      false

expression: a!=b
value:      true

expression: a<b
value:      error("on line 82, true<false: unsupported operator on boolean")

expression: a>b
value:      error("on line 83, true>false: unsupported operator on boolean")

expression: a<=b
value:      error("on line 84, true<=false: unsupported operator on boolean")

expression: a>=b
value:      error("on line 85, true>=false: unsupported operator on boolean")

expression: f==g
value:      false

expression: f!=g
value:      true

expression: f<g
value:      true

expression: f>g
value:      false

expression: f<=g
value:      true

expression: f>=g
value:      false

expression: x==y
value:      false

expression: x!=y
value:      true

expression: x<y
value:      true

expression: x>y
value:      false

expression: x<=y
value:      true

expression: x>=y
value:      false

expression: a+b
value:      error("on line 101, true+false: unsupported operator on boolean")

expression: a-b
value:      error("on line 102, true-false: unsupported operator on boolean")

expression: a*b
value:      error("on line 103, true*false: unsupported operator on boolean")

expression: a/b
value:      error("on line 104, true/false: unsupported operator on boolean")

expression: a%b
value:      error("on line 105, true%false: unsupported operator on boolean")

expression: f+g
value:      3.64159

expression: f-g
value:      -2.64159

expression: f*g
value:      1.5708

expression: f/g
value:      0.159155

expression: f%g
value:      0

expression: x+y
value:      30

expression: x-y
value:      -10

expression: x*y
value:      200

expression: x/y
value:      0

expression: x%y
value:      10

expression: x and y
value:      error("on line 118, 10 and 20: unsupported operator on integer")

expression: x or y
value:      error("on line 119, 10 or 20: unsupported operator on integer")

expression: x and y
value:      error("on line 120, 10 and 20: unsupported operator on integer")

expression: x or y
value:      error("on line 121, 10 or 20: unsupported operator on integer")

expression: (x+y)*(f+g)
value:      109.248

expression: 10+20*30
value:      610

expression: 10*(20+30)
value:      500

expression: a==b or (f>g and x<y)
value:      false

expression: a==b or (f>g and x<y)
value:      false

expression: [[0,i] for i in [1,2,x],10,-90.5,true for i in range(5),false,null,[-1,-2,-3]]
value:      [[0,1],[0,2],[0,10],10,-90.5,true,true,true,true,true,false,null,[-1,-2,-3]]

expression: [format(":%d",2*i) for i in range(10)]
value:      [":0",":2",":4",":6",":8",":10",":12",":14",":16",":18"]

expression: [i+1 for i in [10-i for i in range(10)]]
value:      [11,10,9,8,7,6,5,4,3,2]

expression: [[[i,j] for j in range(3)] for i in [10-i for i in range(4)]]
value:      [[[10,0],[10,1],[10,2]],[[9,0],[9,1],[9,2]],[[8,0],[8,1],[8,2]],[[7,0],[7,1],[7,2]]]

expression: [null for i in 7]
value:      error("on line 134: list comprehension takes an array")

expression: [i for i in range(10) if i%3==0]
value:      [0,3,6,9]

expression: [[i,j] for i in range(4) for j in range(3)]
value:      [[0,0],[0,1],[0,2],[1,0],[1,1],[1,2],[2,0],[2,1],[2,2],[3,0],[3,1],[3,2]]

expression: [[i,j] for i in range(5) for j in range(4) if (i+j)%2==0]
value:      [[0,0],[0,2],[1,1],[1,3],[2,0],[2,2],[3,1],[3,3],[4,0],[4,2]]

expression: [[i,j] for i in range(5) for j in range(4) if j%2==1]
value:      [[0,1],[0,3],[1,1],[1,3],[2,1],[2,3],[3,1],[3,3],[4,1],[4,3]]

expression: [[i,j] for i in range(5) if i%2==0 for j in range(4) if j%2==1]
value:      [[0,1],[0,3],[2,1],[2,3],[4,1],[4,3]]

expression: [[i,j] for i in range(5) if j%2==0 for j in range(4) if i%2==1]
value:      error("on line 140, j: undefined symbol")

expression: [[i,j,k,l] for i in range(4) for j in range(3) for k in range(3) for l in [true,false]]
value:      [[0,0,0,true],[0,0,0,false],[0,0,1,true],[0,0,1,false],[0,0,2,true],[0,0,2,false],[0,1,0,true],[0,1,0,false],[0,1,1,true],[0,1,1,false],[0,1,2,true],[0,1,2,false],[0,2,0,true],[0,2,0,false],[0,2,1,true],[0,2,1,false],[0,2,2,true],[0,2,2,false],[1,0,0,true],[1,0,0,false],[1,0,1,true],[1,0,1,false],[1,0,2,true],[1,0,2,false],[1,1,0,true],[1,1,0,false],[1,1,1,true],[1,1,1,false],[1,1,2,true],[1,1,2,false],[1,2,0,true],[1,2,0,false],[1,2,1,true],[1,2,1,false],[1,2,2,true],[1,2,2,false],[2,0,0,true],[2,0,0,false],[2,0,1,true],[2,0,1,false],[2,0,2,true],[2,0,2,false],[2,1,0,true],[2,1,0,false],[2,1,1,true],[2,1,1,false],[2,1,2,true],[2,1,2,false],[2,2,0,true],[2,2,0,false],[2,2,1,true],[2,2,1,false],[2,2,2,true],[2,2,2,false],[3,0,0,true],[3,0,0,false],[3,0,1,true],[3,0,1,false],[3,0,2,true],[3,0,2,false],[3,1,0,true],[3,1,0,false],[3,1,1,true],[3,1,1,false],[3,1,2,true],[3,1,2,false],[3,2,0,true],[3,2,0,false],[3,2,1,true],[3,2,1,false],[3,2,2,true],[3,2,2,false]]

expression: list[2]
value:      300

expression: list[-1]
value:      300

expression: list[-3]
value:      100

expression: list[-10]
value:      error("array reference on line 146: index out of range")

expression: list[1:]
value:      [200,300]

expression: list[:2]
value:      [100,200]

expression: list[1:2]
value:      [200]

expression: list[:]
value:      [100,200,300]

expression: list[3:2]
value:      []

expression: list[-11:3]
value:      [100,200,300]

expression: list[3:-11]
value:      []

expression: list[1:-1]
value:      [200]

expression: list[-1:1]
value:      []

expression: list[0:100]
value:      [100,200,300]

expression: list[true:4]
value:      error("on line 0, true:4: slice indices must be integers")

expression: list[4:null]
value:      error("on line 0, 4:null: slice indices must be integers")

expression: list[true:false]
value:      error("on line 0, true:false: slice indices must be integers")

expression: object["house"]
value:      "home"

expression: {"command":"grep English "+infile+" > "+outfile,"inputs":["/usr/bin/grep",infile],"outputs":[outfile],"environment":{"PATH":"/usr/bin"},"cores":1,"memory":16,"disk":1}
value:      {"command":"grep English mydata > results","inputs":["/usr/bin/grep","mydata"],"outputs":["results"],"environment":{"PATH":"/usr/bin"},"cores":1,"memory":16,"disk":1}

expression: range(5)
value:      [0,1,2,3,4]

expression: range(3,7)
value:      [3,4,5,6]

expression: range(7,3)
value:      []

expression: range(-1,10,2)
value:      [-1,1,3,5,7,9]

expression: range(1,10,0)
value:      error("function range on line 0: step must be nonzero")

expression: range(0,5,-1)
value:      []

expression: range(5,0,1)
value:      []

expression: range(5,0,-1)
value:      [5,4,3,2,1]

expression: format()
value:      error("function format on line 0: invalid/missing format string")

expression: format("%%")
value:      "%"

expression: format("value: %i!!",x+y)
value:      "value: 30!!"

expression: format("%i",x,y)
value:      error("function format on line 0: too many arguments for format specifier")

expression: format("(%d, %i)",x,y)
value:      "(10, 20)"

expression: format("%i")
value:      error("function format on line 0: mismatched format specifier")

expression: format("%e",1.2e-22)
value:      "1.200000e-22"

expression: format("%E",6.02e+23)
value:      "6.020000E+23"

expression: format("%f",2.5)
value:      "2.500000"

expression: format("%F",3.14)
value:      "3.140000"

expression: format("%g",9.9e+09)
value:      "9.9e+09"

expression: format("%G",2.11111e-12)
value:      "2.11111E-12"

expression: format("%s","foo")
value:      "foo"

expression: 10+[1]
value:      error("on line 195, 10+[1]: mismatched types for operator")

expression: "abc"+[2]
value:      error("on line 196, \"abc\"+[2]: mismatched types for operator")

expression: []+[]
value:      []

expression: []+[1]
value:      [1]

expression: [1]+[]
value:      [1]

expression: [1,2]+[3]
value:      [1,2,3]

expression: [1,2]+[]+[4,[5,6]]
value:      [1,2,4,[5,6]]

expression: [10]==[10]
value:      true

expression: [10]!=[10]
value:      false

expression: [1,2,3]==[1,3,2]
value:      false

expression: [1,2,[3,4]]==[1,2,[3,4]]
value:      true

expression: ceil(f)
value:      1

expression: ceil()
value:      error("function ceil on line 0: too few arguments")

expression: ceil([])
value:      error("function ceil on line 0: arg of invalid type")

expression: ceil(x)
value:      10

expression: ceil(g)
value:      4

expression: ceil(x,f)
value:      error("function ceil on line 0: too many arguments")

expression: ceil("foo")
value:      error("function ceil on line 0: arg of invalid type")

expression: floor(f)
value:      0

expression: floor()
value:      error("function floor on line 0: too few arguments")

expression: floor([])
value:      error("function floor on line 0: arg of invalid type")

expression: floor(x)
value:      10

expression: floor(g)
value:      3

expression: floor(x,f)
value:      error("function floor on line 0: too many arguments")

expression: floor("foo")
value:      error("function floor on line 0: arg of invalid type")

expression: join([])
value:      ""

expression: join([],"")
value:      ""

expression: join(["a","b","c","d"]," ")
value:      "a b c d"

expression: join()
value:      error("function join on line 0: too few arguments to join")

expression: join([a,b,c])
value:      error("on line 227, c: undefined symbol")

expression: join(["a","b","c","d"])
value:      "a b c d"

expression: join(",",["a","b"])
value:      error("function join on line 0: A list must be the first argument in join")

expression: join(["a","b"],",")
value:      "a,b"

expression: join(["a","b"])
value:      "a b"

expression: basename("/usr/lib")
value:      "lib"

expression: basename("/usr/")
value:      "usr"

expression: basename("usr")
value:      "usr"

expression: basename("file.txt")
value:      "file.txt"

expression: basename("file.txt",".txt")
value:      "file"

expression: basename("file.txt",".csv")
value:      "file.txt"

expression: basename("/")
value:      "/"

expression: basename(".")
value:      "."

expression: basename("..")
value:      ".."

expression: dirname("/usr/lib")
value:      "/usr"

expression: dirname("/usr/")
value:      "/"

expression: dirname("usr")
value:      "."

expression: dirname("/")
value:      "/"

expression: dirname(".")
value:      "."

expression: dirname("..")
value:      "."

expression: listdir()
value:      error("function listdir on line 0 takes one argument, 0 given")

expression: listdir(7)
value:      error("function listdir on line 0 takes a string path")

expression: listdir("-")
value:      error("function listdir on line 0: -, No such file or directory")

expression: listdir("dir")
value:      ["a"]

expression: escape("test")
value:      "\"test\""

expression: escape("echo $PATH")
value:      "\"echo \\$PATH\""

expression: escape("$(pwd)/\"test program\" -x `date`")
value:      "\"\\$(pwd)/\\\"test program\\\" -x \\`date\\`\""

expression: escape("y\\x")
value:      "\"y\\\\x\""

expression: "hello "+1+" world"
value:      "hello 1 world"

expression: true+" maybe "+false
value:      "true maybe false"

expression: "pi is "+3.14159
value:      "pi is 3.14159"

expression: error({"source":"jx_eval","op":10+[1],"line":409,"file":"jx_eval.c","message":"mismatched types for operator","name":"TypeError"})
value:      error({"source":"jx_eval","op":10+[1],"line":409,"file":"jx_eval.c","message":"mismatched types for operator","name":"TypeError"})

