On 06-Jan-2014 Bram Moolenaar <[email protected]> wrote:
> 
> Lech Lorens wrote:
> 
> > Yesterday while remotely debugging some Vim scripts I discovered 
> > (actually it is mentioned in the documentation) that remote_expr() 
> > imposes a limitation on the type of expressions handled: the expression 
> > must be a string or a list (although the implementation correctly 
> > handles integers and floats as well).
> > 
> > I am wondering if there is a good reason for this limitation. In the 
> > attached patch I applied the logic from f_string() on the result of 
> > expression, thus eliminating the limitation.
> > 
> > Please, comment.
> > 
> > If the patch is to be applied upstream, documentation for remote_expr() 
> > should be updated.
> 
> What happens with nested lists and dicts?

Whatever you think would be best. Currently exactly the same that would 
happen locally for string(list_var) or string(dict_var). I find it more 
usable than the current behaviour of sending list items separated by 
newline characters (but it's backwards incompatible, of course).

E.g. I got this with remote_expr():

Remote Vim claims that g:test_list  = "[[101, 102, 103, 104], [201, 202, 203, 
204, [101, 102, 103, 104]], [301, 302, 303, 304, [201, 202, 203, 204, [101, 
102, 103, 104]]], {'foo': 'bar', 'baz': 'quux', 'dict1': {'foo': 'FOO', 'baz': 
'BAZ', 'bar': 'BAR', 'dict2': {'list1': [101, 102, 103, 104], 'list2': [201, 
202, 203, 204, [101, 102, 103, 104]], 'list3': [301, 302, 303, 304, [201, 202, 
203, 204, [101, 102, 103, 104]]]}}, 'bar': 'baz'}]"

Remote Vim claims that g:test_dict0 = "{'foo': 'bar', 'baz': 'quux', 'dict1': 
{'foo': 'FOO', 'baz': 'BAZ', 'bar': 'BAR', 'dict2': {'list1': [101, 102, 103, 
104], 'list2': [201, 202, 203, 204, [101, 102, 103, 104]], 'list3': [301, 302, 
303, 304, [201, 202, 203, 204, [101, 102, 103, 104]]]}}, 'bar': 'baz'}"

-- 
Lech Lorens

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Raspunde prin e-mail lui