ZyX wrote:
> >3. vim.functions:
> > Again, the introspection is not strictly necessary, but a convenience
> > wrapper that pulls the FuncRefs will make code look much nicer.
> > In that regard I'd also offer attribute access for builtin/ global
> > functions in addition to the getitem syntax. That way you can do
> > things like:
> > curbuf = vim.functions.bufnr("%")
>
> Good idea.
Would it be possible to have most Vim functions made callable from
Python this way? Obviously it's much better than using vim.eval().
An example from the help:
:py tagList = vim.eval('taglist("eval_expr")')
Would then be something like:
:py tagList = vim.functions.taglist(eval_expr)
With the difference that eval_expr would be a Python expression.
For the internals we would need to have a list of all funtions with
their argument types, so that the arguments can be converted from Python
to the Vim type. Could be added to the functions array in eval.c
A big advantage is that it's going to be much easier to add
functionality both to Vim and the Python interface.
--
ARTHUR: I command you as King of the Britons to stand aside!
BLACK KNIGHT: I move for no man.
The Quest for the Holy Grail (Monty Python)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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.