I am beginning to understand a bit more but
not quite all yet:

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
[...]
> > 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 is not concatenation, this is listing a string and a list
> separately.
> 

OK, got it, so is adding a blank correct? (I verified
it happens always when using this form without a '.',
not related to echo'ing lists).
Like this:
let q=1
:echo "q="q
-> q= 1

but to confuse the thing:
:echo "q="   q
-> q= 1
So it ignores all blanks in the echo. Probably OK
if it didn't always add 1 when there is no blank (above).

[...]
> > 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?
> 
> It's a difference between concatenation with "." and listing two
> separate things.

I now understand this case, however, how did the 'd'
suddenly become a string (at least it doesn't give
an error in :echo, see first case above)
when it was obtained from the list?
Is it the case that the conversion takes place "when it can"?
Or are there better rules?

> 
> You can use string() to convert a list to a string before 
> concatenating
> it to another string.
> 

Thanks for this, I missed it in the doc.

---Zdenek

Reply via email to