This is formatted as a script that you can cut & run.
The -> indicates the output of the 'echo' command.
Ignore comments at the beginning of the line, they are there
only to prevent useless errors.

-------------- [script start] ----
let a = [[1,2], [3,4]]
echo a
" -> [[1,2], [3,4]]
"  This works

echo "list a=".a
" E730: using List as a String
" E15: Invalid expression: "list a=".a
"  So no conversion list->string is done here

echo "list a="a
" -> list a= [[1,2], [3,4]]
"  This works, but why? Isn't this also concatenation of two strings?
" Note: it adds a blank after '=' sign, why?

" This gets more obscure as you go on IMHO:
let c=a[1]
echo c
" -> [3,4]
"  That's OK

echo "list c=".c
" -> I get the same error, not surprising
" -> E730: using List as a String
" -> E15: Invalid expression: "list c=".c

echo "list c="c a[0]
" -> list c= [3,4] [1,2]
"  This also works, seems to me also a mixture of string and list
"  so it shouldn't work, or is it correct?

let d=c[0]
echo d
" -> 3
"  Correct

echo "list d=".d
" -> list d=3
"  So here it works? 'd' is suddenly considered a string?
"  While it was obtained from the list?

echo "list d="d
" -> list d= 3
"  That works, too, with additional blank after '='
----------------------- [script end] -----------

The last two cases are confusing the whole issue.
So when a string and a list can be mixed, when not,
what are the rules, or are some of the above bugs?

---Zdenek

Reply via email to