scicloj / clojisr

Clojure speaks statistics - a bridge between Clojure to R
https://scicloj.github.io/clojisr/
Eclipse Public License 2.0
154 stars 10 forks source link

empty-symbol in functional call #58

Open genmeblog opened 4 years ago

genmeblog commented 4 years ago

Looks like there are cases when creation of empty-symbol fails.

I found a case when (bra data.table nil something) throws an exception about missing value.

The root of a problem lays with the fact that empty symbol cannot be assigned to a value (http://adv-r.had.co.nz/Expressions.html#names). When we evaluate something it's always assigned to a value.

What seems to work perfectly is artificial RObject:

(def empty-symbol (clojisr.v1.robject/->RObject "" (:session (r 1)) nil ["name"]))

That means to we have to have special case for RObject recreation during session change. When we set code to nil they should stay untouched.

genmeblog commented 4 years ago

For such created empty-symbol we need to fix printing (we can't evaluate it).

genmeblog commented 4 years ago

Maybe even session should be nil and never be assigned to the session

genmeblog commented 7 months ago

Since it require a session empty-symbol should be a function.