961168f3b6
The `Analyzer` is now responsible for determining the purity of `Define` bindings. Previously, this responsibility was left to the caller. Added a new example `design-flaw.myc` to test this change. Updated `soa_series.myc` due to the purity change.
18 lines
468 B
Plaintext
18 lines
468 B
Plaintext
;; Output: 26.7
|
|
;; Benchmark: 1.4us
|
|
;; Benchmark-Repeat: 1406
|
|
(do
|
|
(def my_ticks (series 100 {:price :float :volume :int :msg :text}))
|
|
|
|
(push my_ticks {:price 10.5 :volume 100 :msg "A"})
|
|
(push my_ticks {:price 11.2 :volume 200 :msg "B"})
|
|
(push my_ticks {:price 15.5 :volume 300 :msg "C"})
|
|
|
|
;(repeat n 100 (push my_ticks {:price (+ n 15.5) :volume (ceil (/ n 300)) :msg "??"})
|
|
|
|
|
|
(def prices (.price my_ticks))
|
|
|
|
(+ (prices 0) (prices 1))
|
|
)
|