StatsModels.jl icon indicating copy to clipboard operation
StatsModels.jl copied to clipboard

Allowing a term to be empty should be useful for operations on terms

Open junyuan-chen opened this issue 4 years ago • 0 comments

Operations like () + term(:x) and termvars(()) are disallowed by #214. But, I actually find them convenient.

I understand that empty tuples should not be turned into a TupleTerm (#213). But, I don't see why a term should never be empty. There are use cases in which some manipulation on terms are involved. An "empty term" may well arise in the intermediate process. After #214, the possibility of becoming empty need to be handled separately.

A fix that wraps NTuple inside a custom type for Terms seems to be a more appealing alternative.

junyuan-chen avatar Feb 15 '21 21:02 junyuan-chen