im getting a list that was saved as a string, and trying to parse it to use. I can use Meta.parse, to turn the string into an expression :
li = db.list
print(typeof(d[1]),d[1])
>> String
["apple", "banana", "coconut"]
parsed_li = Meta.parse(d[1])
print(typeof(parsed_li), parsed_li)
>> Expr
["apple", "banana", "coconut"]
but it doesnt seem like i can use it like a normal list ; for example, with a normal list i could access an element by its index, but i cannot access the index of the Expr object :
normal_li = ["apple", "banana", "coconut"]
print(normal_li[1])
>> apple
print(parsed_li[1])
>>
MethodError: no method matching getindex(::Expr, ::Int64)
Stacktrace:
[1] top-level scope at In[214]:8
i've been tinkering , not sure what I'm missing here!