Make distinction between value types within Ion
Created by: huntergoldstein
Problem
Everything is, by default, an Array
when expanding strings. For example, the expression
$(foo bar baz)
is supposed to expand to a string, but currently this expands to a one element array. There are plenty of other similar cases, for example ""
expanding to the empty array versus the empty string.
Solution
Introduce a true value type, something like:
enum Value {
String(SmallString)
Array(SmallVec<Value>)
}
Considerations
- Expressions such as
foo @bar
, wherebar = [0 1 2 ...]
currently expand tofoo 0 1 2 ...
with each element ofbar
becoming an argument tofoo
andfoo "@bar"
for passingbar
itself as an argument.- Perhaps we have explicit array passing here with
foo [@bar]
- Perhaps we have explicit array passing here with
- Typed function arguments: do we want to add
bool
andint
types? Also see #480 (closed).