Not only would that not be idiomatic, the operator for modulus in Common LISP is mod not %. and the brackets you and the parent used in the s-expr are around the wrong groups of symbols. So you're more likely to see:
(mod (* (+ 1 x) (- 2 3)) x)
or maybe with some limited indentation, such as:
(mod
(* (+ 1 x) (- 2 3))
x) (foo
(bar
(baz (bax x 2)
"hello")
"world")
"!")
>the brackets you and the parent used in the s-expr are around the wrong groups of symbolsNo they're not. Yours is wrong. Multiplication has higher priority than addition so the order of evaluation begins with (x * 2) not (1 + x).
OK, I shouldn't have gone that far.
FWIW, modulus has the same operator precedence as multiplication and division.
So really, it is more like:
(- (+ 1 (* x 2))
(mod 3 x))
or using the increment function:(- (1+ (* x 2))
(mod 3 x))(defn run-analysis [path]
;load data from converted arrow file
(let [data (load-data path)]
(-> data
;; Calc a Weeknumber, Ad_Channel, and filter Ad_Channel for retail
add-columns
;; Agg data by DC, Store, WeekNum, Item and sum qty and count lines
rolled-ds
;; Now Agg again, this time counting the weeks and re-sum qty and lines
roll-again)))
;;Run the whole thing(time (run-analysis arrow-path))
This code processes 27 million lines in 75 seconds (shout out to https://techascent.github.io/tech.ml.dataset/100-walkthrough... library)
(% (- (+ (* x 2)
1)
3)
x)
"take x, times it by 2, add one, subtract 3, take modulus with the original x".
It's pretty much how you'd type it into a calculator.
EDIT: care to explain the downvote?