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{"source":"jx_eval","name":"unsupported operator","message":"unsupported operator on boolean","line":82,"operator":true<false,"code":1}

expression: a>b
value:      Error{"source":"jx_eval","name":"unsupported operator","message":"unsupported operator on boolean","line":83,"operator":true>false,"code":1}

expression: a<=b
value:      Error{"source":"jx_eval","name":"unsupported operator","message":"unsupported operator on boolean","line":84,"operator":true<=false,"code":1}

expression: a>=b
value:      Error{"source":"jx_eval","name":"unsupported operator","message":"unsupported operator on boolean","line":85,"operator":true>=false,"code":1}

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{"source":"jx_eval","name":"unsupported operator","message":"unsupported operator on boolean","line":101,"operator":true+false,"code":1}

expression: a-b
value:      Error{"source":"jx_eval","name":"unsupported operator","message":"unsupported operator on boolean","line":102,"operator":true-false,"code":1}

expression: a*b
value:      Error{"source":"jx_eval","name":"unsupported operator","message":"unsupported operator on boolean","line":103,"operator":true*false,"code":1}

expression: a/b
value:      Error{"source":"jx_eval","name":"unsupported operator","message":"unsupported operator on boolean","line":104,"operator":true/false,"code":1}

expression: a%b
value:      Error{"source":"jx_eval","name":"unsupported operator","message":"unsupported operator on boolean","line":105,"operator":true%false,"code":1}

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{"source":"jx_eval","name":"unsupported operator","message":"unsupported operator on integer","line":118,"operator":10 and 20,"code":1}

expression: x or y
value:      Error{"source":"jx_eval","name":"unsupported operator","message":"unsupported operator on integer","line":119,"operator":10 or 20,"code":1}

expression: x and y
value:      Error{"source":"jx_eval","name":"unsupported operator","message":"unsupported operator on integer","line":120,"operator":10 and 20,"code":1}

expression: x or y
value:      Error{"source":"jx_eval","name":"unsupported operator","message":"unsupported operator on integer","line":121,"operator":10 or 20,"code":1}

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{"source":"jx_eval","name":"mismatched types","message":"list comprehension takes an array","line":134,"list":7,"code":2}

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{"source":"jx_eval","name":"undefined symbol","message":"undefined symbol","line":140,"context":{"i":0,"escape":escape,"dirname":dirname,"basename":basename,"floor":floor,"ceil":ceil,"join":join,"format":format,"range":range,"outfile":"results","infile":"mydata","a":true,"b":false,"f":0.5,"g":3.14159,"x":10,"y":20,"list":[100,200,300],"object":{"house":"home"}},"symbol":j,"code":0}

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{"source":"jx_eval","name":"range error","message":"index out of range","index":-10,"array":[100,200,300],"code":4}

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{"source":"jx_eval","name":"mismatched types","message":"slice indices must be integers","operator":true:4,"code":2}

expression: list[4:null]
value:      Error{"source":"jx_eval","name":"mismatched types","message":"slice indices must be integers","operator":4:null,"code":2}

expression: list[true:false]
value:      Error{"source":"jx_eval","name":"mismatched types","message":"slice indices must be integers","operator":true:false,"code":2}

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{"source":"jx_eval","name":"invalid arguments","message":"step must be nonzero","function":range(1,10,0),"code":6}

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{"source":"jx_eval","name":"invalid arguments","message":"invalid/missing format string","function":format(),"code":6}

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

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

expression: format("%i",x,y)
value:      Error{"source":"jx_eval","name":"invalid arguments","message":"too many arguments for format specifier","function":format("%i",10,20),"code":6}

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

expression: format("%i")
value:      Error{"source":"jx_eval","name":"invalid arguments","message":"mismatched format specifier","function":format("%i"),"code":6}

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{"source":"jx_eval","name":"mismatched types","message":"mismatched types for operator","line":195,"operator":10+[1],"code":2}

expression: "abc"+[2]
value:      Error{"source":"jx_eval","name":"mismatched types","message":"mismatched types for operator","line":196,"operator":"abc"+[2],"code":2}

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{"source":"jx_eval","name":"invalid arguments","message":"too few arguments","function":ceil(),"code":6}

expression: ceil([])
value:      Error{"source":"jx_eval","name":"invalid arguments","message":"arg of invalid type","function":ceil([]),"code":6}

expression: ceil(x)
value:      10

expression: ceil(g)
value:      4

expression: ceil(x,f)
value:      Error{"source":"jx_eval","name":"invalid arguments","message":"too many arguments","function":ceil(10,0.5),"code":6}

expression: ceil("foo")
value:      Error{"source":"jx_eval","name":"invalid arguments","message":"arg of invalid type","function":ceil("foo"),"code":6}

expression: floor(f)
value:      0

expression: floor()
value:      Error{"source":"jx_eval","name":"invalid arguments","message":"too few arguments","function":floor(),"code":6}

expression: floor([])
value:      Error{"source":"jx_eval","name":"invalid arguments","message":"arg of invalid type","function":floor([]),"code":6}

expression: floor(x)
value:      10

expression: floor(g)
value:      3

expression: floor(x,f)
value:      Error{"source":"jx_eval","name":"invalid arguments","message":"too many arguments","function":floor(10,0.5),"code":6}

expression: floor("foo")
value:      Error{"source":"jx_eval","name":"invalid arguments","message":"arg of invalid type","function":floor("foo"),"code":6}

expression: join([])
value:      ""

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

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

expression: join()
value:      Error{"source":"jx_eval","name":"invalid arguments","message":"too few arguments to join","function":join(),"code":6}

expression: join([a,b,c])
value:      Error{"source":"jx_eval","name":"undefined symbol","message":"undefined symbol","line":227,"context":{"escape":escape,"dirname":dirname,"basename":basename,"floor":floor,"ceil":ceil,"join":join,"format":format,"range":range,"outfile":"results","infile":"mydata","a":true,"b":false,"f":0.5,"g":3.14159,"x":10,"y":20,"list":[100,200,300],"object":{"house":"home"}},"symbol":c,"code":0}

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

expression: join(",",["a","b"])
value:      Error{"source":"jx_eval","name":"invalid arguments","message":"A list must be the first argument in join","function":join(",",["a","b"]),"code":6}

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("/")
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: 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"}

