Closed daslu closed 4 years ago
Prepared a branch numbers
Still testing and need to write tests in tutorial
(r/->code 1)
;; => "1"
(r 1)
;; => [1] 1
(r/->code '(+ 1 2.1))
;; => "(1 + 2.1)"
(r '(+ 1 2.1))
;; => [1] 3.1
(r/->code 2/3)
;; => "(2/3)"
(r 2/3)
;; => [1] 0.66666667
(r/->code '(+ 1 2.0 3/4))
;; => "(1 + 2.0 + (3/4))"
(r '(+ 1 2.0 3/4))
;; => [1] 3.75
(r/->code true)
;; => "TRUE"
(r true)
;; => [1] TRUE
(r/->code (> 3 4))
;; => "FALSE"
(r (> 3 4))
;; => [1] FALSE
BETA9-SNAPSHOT
Currently, the
->code
function for code generation converts almost all Clojure values (except for symbols and functions) to corresponding RObjects, and puts these objects' temporary names in the generated code.See the
E.g.:
For simple primitive values, such as number, strings and booleans, we would rather put those values explicitly in the generated R code.
That is, what we want is this:
This is will require a rather small change at the codegen namespace, and some adapdtation of the tests.