четверг, 19 апреля 2012 г., 21:53:43 UTC+4 пользователь ZyX написал:
> понедельник, 16 апреля 2012 г., 19:24:21 UTC+4 пользователь ZyX написал:
> > понедельник, 16 апреля 2012 г., 4:46:27 UTC+4 пользователь Luis Carvalho
> > написал:
> > > <snip>
> > > > > So is this patch ready to be included now?
> > > > > Or should we wait until Python 3 is supported?
> > > >
> > > > Attached patch adds both python and python3 extended support (also adds
> > > > luaeval to syntax/vim.vim as it is absent there).
> > > <snip>
> > >
> > > Thanks for the great job! Since you're hacking at eval.c, can I ask you to
> > > also add the following to the prototype, i.e., promote them from static to
> > > extern:
> > >
> > > - listitem_alloc, list_find, list_remove, list_append (for symmetry with
> > > dicts)
> > > - set_ref_in_ht, set_ref_in_list, set_ref_in_item (you copied from
> > > if_lua, but
> > > I copied and adapted them from eval.c before)
> > >
> > > Besides avoiding redundancies, these changes enrich the API and make for
> > > an
> > > easier road to other language bindings. Thanks again!
> >
> > Here is the patch with functions promoted. Other differences between
> > previously posted one:
> > 1. Removed pyhashtab_T which is difficult to maintain (I definitely have an
> > error there, but unable to track it). Now all references are hold in a
> > linked list (thus no more "one python object for one vim structure",
> > creating python object must be faster as well as removing it (both not for
> > the already referenced structure obviously))
> > 2. pythreeeval() replaced with py3eval().
> > 3. Now using PyDict_Next instead of PyDict_Items which should be faster.
>
> Newer version (diff against lua-changes). Differences:
>
> - Added support for objects that support mapping, sequence and iterator
> protocols
> - Some refactoring: moved ConvertToPyObject, FunctionNew to if_py_both.h, ....
> - Moved some code from ConvertToPyObject to a separate functions
> - Some error fixes: compiling with python3, but without python support, some
> things left from the time I thought it may be a good idea to not raise the
> exceptions under certain conditions.
New version:
1. It is now possible to pyeval() recursive python objects, like this:
py l=[]; l.append(l)
let l=pyeval('l')
echo l is l[0] " True
2. It now uses %p printf format to generate keys for vim.eval(). It is faster
and, I believe, better then casting pointers to unsigned long and printing it
as decimal.
3. python2 now also uses long objects to hold integers, not int objects.
--
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