Vector style operations:
/ prefix sum
+\3*x
/ element by element operations
x*x
/ cross-product of all elements
/ read this "times each right each left"
x*/:\:x
/ generating data
y: !13
/ twelves table, each left, each right (cross-product)
y*\:/:y
Tour of GUI and Tables
`show $ `y
y:y*y / variable multiplication causes gui representation to be updated.
/ Try updating the gui and they will be updated.
/ tables
n: 1000
names: `bob `ted `carol `alice
emp.salary: 20000 + n _draw 10000
emp.name: names[n _draw #names]
emp.manager: names[n _draw #names]
`show $ `emp
/ modify salary to be twice the salary
emp.salary: 2*emp.salary
/ create a chart
emp.salary..c:`chart
`show $ `emp.salary
Tour -- Functions
/ present value calculation
presentval:{[amount; discount; exponent]
+/ (amount%(discount^exponent))}
amount: 100 125 200 150 117
discountrate: 1.05
exponent: 0 0.5 1 1.5 2
presentval[amount;discountrate;exponent]