Operators
!=
x <a[integer,string,time,decimal,bool,[<l>],object:<{o}>,keyset,guard,module{}]>
y <a[integer,string,time,decimal,bool,[<l>],object:<{o}>,keyset,guard,module{}]>
→ bool
True if X does not equal Y.
pact> (!= "hello" "goodbye")truepact> (!= "hello" "goodbye")true&
x integer y integer → integer
Compute bitwise X and Y.
pact> (& 2 3)2pact> (& 5 -7)1pact> (& 2 3)2pact> (& 5 -7)1*
x <a[integer,decimal]> y <a[integer,decimal]>
→ <a[integer,decimal]>
x <a[integer,decimal]> y <b[integer,decimal]>
→ decimal
Multiply X by Y.
pact> (* 0.5 10.0)5.0pact> (* 3 5)15pact> (* 0.5 10.0)5.0pact> (* 3 5)15+
x <a[integer,decimal]> y <a[integer,decimal]>
→ <a[integer,decimal]>
x <a[integer,decimal]> y <b[integer,decimal]>
→ decimal
x <a[string,[<l>],object:<{o}>]>
y <a[string,[<l>],object:<{o}>]>
→ <a[string,[<l>],object:<{o}>]>
Add numbers, concatenate strings/lists, or merge objects.
pact> (+ 1 2)3pact> (+ 5.0 0.5)5.5pact> (+ "every" "body")"everybody"pact> (+ [1 2] [3 4])[1 2 3 4]pact> (+ { "foo": 100 } { "foo": 1, "bar": 2 }){"bar": 2,"foo": 100}pact> (+ 1 2)3pact> (+ 5.0 0.5)5.5pact> (+ "every" "body")"everybody"pact> (+ [1 2] [3 4])[1 2 3 4]pact> (+ { "foo": 100 } { "foo": 1, "bar": 2 }){"bar": 2,"foo": 100}-
x <a[integer,decimal]> y <a[integer,decimal]>
→ <a[integer,decimal]>
x <a[integer,decimal]> y <b[integer,decimal]>
→ decimal
x <a[integer,decimal]> → <a[integer,decimal]>
Negate X, or subtract Y from X.
pact> (- 1.0)-1.0pact> (- 3 2)1pact> (- 1.0)-1.0pact> (- 3 2)1/
x <a[integer,decimal]> y <a[integer,decimal]>
→ <a[integer,decimal]>
x <a[integer,decimal]> y <b[integer,decimal]>
→ decimal
Divide X by Y.
pact> (/ 10.0 2.0)5.0pact> (/ 8 3)2pact> (/ 10.0 2.0)5.0pact> (/ 8 3)2<
x <a[integer,decimal,string,time]>
y <a[integer,decimal,string,time]> → bool
True if X < Y.
pact> (< 1 3)truepact> (< 5.24 2.52)falsepact> (< "abc" "def")truepact> (< 1 3)truepact> (< 5.24 2.52)falsepact> (< "abc" "def")true<=
x <a[integer,decimal,string,time]>
y <a[integer,decimal,string,time]> → bool
True if X <= Y.
pact> (<= 1 3)truepact> (<= 5.24 2.52)falsepact> (<= "abc" "def")truepact> (<= 1 3)truepact> (<= 5.24 2.52)falsepact> (<= "abc" "def")true=
x <a[integer,string,time,decimal,bool,[<l>],object:<{o}>,keyset,guard,module{}]>
y <a[integer,string,time,decimal,bool,[<l>],object:<{o}>,keyset,guard,module{}]>
→ bool
Compare alike terms for equality, returning TRUE if X is equal to Y. Equality comparisons will fail immediately on type mismatch, or if types are not value types.
pact> (= [1 2 3] [1 2 3])truepact> (= 'foo "foo")truepact> (= { 'a: 2 } { 'a: 2})truepact> (= [1 2 3] [1 2 3])truepact> (= 'foo "foo")truepact> (= { 'a: 2 } { 'a: 2})true>
x <a[integer,decimal,string,time]>
y <a[integer,decimal,string,time]> → bool
True if X > Y.
pact> (> 1 3)falsepact> (> 5.24 2.52)truepact> (> "abc" "def")falsepact> (> 1 3)falsepact> (> 5.24 2.52)truepact> (> "abc" "def")false>=
x <a[integer,decimal,string,time]>
y <a[integer,decimal,string,time]> → bool
True if X >= Y.
pact> (>= 1 3)falsepact> (>= 5.24 2.52)truepact> (>= "abc" "def")falsepact> (>= 1 3)falsepact> (>= 5.24 2.52)truepact> (>= "abc" "def")false^
x <a[integer,decimal]> y <a[integer,decimal]>
→ <a[integer,decimal]>
x <a[integer,decimal]> y <b[integer,decimal]>
→ decimal
Raise X to Y power.
pact> (^ 2 3)8pact> (^ 2 3)8abs
x decimal → decimal
x integer → integer
Absolute value of X.
pact> (abs (- 10 23))13pact> (abs (- 10 23))13and
x bool y bool → bool
Boolean logic with short-circuit.
pact> (and true false)falsepact> (and true false)falseand?
a x:<r> -> bool b x:<r> -> bool value <r>
→ bool
Apply logical 'and' to the results of applying VALUE to A and B, with short-circuit.
pact> (and? (> 20) (> 10) 15)falsepact> (and? (> 20) (> 10) 15)falseceiling
x decimal prec integer → decimal
x decimal → integer
Rounds up value of decimal X as integer, or to PREC precision as decimal.
pact> (ceiling 3.5)4pact> (ceiling 100.15234 2)100.16pact> (ceiling 3.5)4pact> (ceiling 100.15234 2)100.16dec
x integer → decimal
Cast an integer to a decimal value of integer X as decimal.
pact> (dec 3)3.0pact> (dec 3)3.0exp
x <a[integer,decimal]> → <a[integer,decimal]>
Exp of X.
pact> (round (exp 3) 6)20.085537pact> (round (exp 3) 6)20.085537floor
x decimal prec integer → decimal
x decimal → integer
Rounds down value of decimal X as integer, or to PREC precision as decimal.
pact> (floor 3.5)3pact> (floor 100.15234 2)100.15pact> (floor 3.5)3pact> (floor 100.15234 2)100.15ln
x <a[integer,decimal]> → <a[integer,decimal]>
Natural log of X.
pact> (round (ln 60) 6)4.094345pact> (round (ln 60) 6)4.094345log
x <a[integer,decimal]> y <a[integer,decimal]>
→ <a[integer,decimal]>
x <a[integer,decimal]> y <b[integer,decimal]>
→ decimal
Log of Y base X.
pact> (log 2 256)8pact> (log 2 256)8mod
x integer y integer → integer
X modulo Y.
pact> (mod 13 8)5pact> (mod 13 8)5not
x bool → bool
Boolean not.
pact> (not (> 1 2))truepact> (not (> 1 2))truenot?
app x:<r> -> bool value <r> → bool
Apply logical 'not' to the results of applying VALUE to APP.
pact> (not? (> 20) 15)falsepact> (not? (> 20) 15)falseor
x bool y bool → bool
Boolean logic with short-circuit.
pact> (or true false)truepact> (or true false)trueor?
a x:<r> -> bool b x:<r> -> bool value <r>
→ bool
Apply logical 'or' to the results of applying VALUE to A and B, with short-circuit.
pact> (or? (> 20) (> 10) 15)truepact> (or? (> 20) (> 10) 15)trueround
x decimal prec integer → decimal
x decimal → integer
Performs Banker's rounding value of decimal X as integer, or to PREC precision as decimal.
pact> (round 3.5)4pact> (round 100.15234 2)100.15pact> (round 3.5)4pact> (round 100.15234 2)100.15shift
x integer y integer → integer
Shift X Y bits left if Y is positive, or right by -Y bits otherwise. Right shifts perform sign extension on signed number types; i.e. they fill the top bits with 1 if the x is negative and with 0 otherwise.
pact> (shift 255 8)65280pact> (shift 255 -1)127pact> (shift -255 8)-65280pact> (shift -255 -1)-128pact> (shift 255 8)65280pact> (shift 255 -1)127pact> (shift -255 8)-65280pact> (shift -255 -1)-128sqrt
x <a[integer,decimal]> → <a[integer,decimal]>
Square root of X.
pact> (sqrt 25)5.0pact> (sqrt 25)5.0xor
x integer y integer → integer
Compute bitwise X xor Y.
pact> (xor 127 64)63pact> (xor 5 -7)-4pact> (xor 127 64)63pact> (xor 5 -7)-4|
x integer y integer → integer
Compute bitwise X or Y.
pact> (| 2 3)3pact> (| 5 -7)-3pact> (| 2 3)3pact> (| 5 -7)-3~
x integer → integer
Reverse all bits in X.
pact> (~ 15)-16pact> (~ 15)-16