Ответ на сообщение «RE: [BUG] Being provided some equal recursive structures, 
equality operator never stops comparison», 
присланное в 12:49:15 23 августа 2010, Понедельник,
отправитель John Beckett:

> The above displays:
> 
> l= [[...]]
> k= [[]]
> 
> I do not know what the "..." means but it is probably a bad
>
If I am not mistaking, ... means ``I already displayed this structure, so I do 
not want to display it for the second time''. Example:
    :let d={}
    :let l=[d, d]
    :echo l
    [{}, {...}]
This makes possible echoing recursive data structures, like the one that causes 
Vim to hang up. Function string() refuses to compose this structures as it is 
not possible to do in a single eval statement.

Текст сообщения:
> ZyX wrote:
> > Attached script, being sourced causes vim to hang up forever.
> > 
> > Test command:
> >     vim -u NONE -c 'so bug.vim'
> 
> To clarify the problem, start Vim 7.3.3 and enter the following
> (this is the essence of the script mentioned above, and will
> 
> cause Vim to hang, so close all files first):
> :let l=[]
> :call add(l, l)
> :let dict4={"l": l}
> :call add(dict4.l, dict4)
> :echo (dict4 ==# deepcopy(dict4))
> 
> The last line causes Vim to hang (CPU goes to 100%, memory is
> not consumed).
> 
> Starting an investigation:
> :let l=[]
> :call add(l, l)
> :echo 'l=' l
> :let k=[]
> :call add(k, deepcopy(k))
> :echo 'k=' k
> 
> The above displays:
> 
> l= [[...]]
> k= [[]]
> 
> I do not know what the "..." means but it is probably a bad
> 
> sign. Further investigation confirms this:
> :redir @a
> :let exp = 'l'
> :for i in range(1, 10)
> :
> :  execute 'let val = ' . exp
> :  echo exp '=' val
> :  unlet val
> :  let exp .= '[0]'
> :
> :endfor
> :redir END
> :$put a
> 
> ---Output---
> l = [[...]]
> l[0] = [[...]]
> l[0][0] = [[...]]
> l[0][0][0] = [[...]]
> l[0][0][0][0] = [[...]]
> l[0][0][0][0][0] = [[...]]
> l[0][0][0][0][0][0] = [[...]]
> l[0][0][0][0][0][0][0] = [[...]]
> l[0][0][0][0][0][0][0][0] = [[...]]
> l[0][0][0][0][0][0][0][0][0] = [[...]]
> 
> Also, the output from:
> :echo string(l)
> 
> is
> E724: variable nested too deep for displaying
> 
> John

Attachment: signature.asc
Description: This is a digitally signed message part.

Raspunde prin e-mail lui