Roland Eggner wrote:
> Hi Bram!
>
> On 2013-05-15 Wednesday at 20:51 +0200 Bram Moolenaar wrote:
> >
> > ZyX wrote:
> >
> > [...]
> >
> > > >Would it be possible to have most Vim functions made callable from
> > > >Python this way? Obviously it's much better than using vim.eval().
> > >
> > > I assumed it be a convenience wrapper replacing
> > >
> > > vim.bindeval('function("bufnr")')('%')
> > >
> > > (obviously, you can save `vim.bindeval('function("bufnr")')` result in
> > > a variable) with a nicer syntax. I believe author of proposal assumed
> > > the same.
> >
> > Calling functions would be a very common thing. Thus I would keep the
> > name as short as possible: vim.f.bufnr('%')
>
> Please keep in mind:
>
> • Identifiers should tell for what purpose they have been created,
> otherwise the source code becomes unmaintainable. E.g. in the Linux
> kernel XFS module several function names are longer than 32
> characters. Probably with reasons. And if you object, no user needs
> to type this function names: think of debugger sessions, think of
> grep commands in the source tree.
"f" means function in my dictionary, no confusion.
You can grep for "vim.f." easily.
> • The age of punch cards is over. Nowadays the common 80 columns
> limit is just a habit without any technical reasons. Few people
> realized it, e.g. the Funtoo Linux Project has a coding standard with
> line length up to 160 characters.
Most of my terminals are 80 columns wide. 100 when editing Java (which
has the problem of too long names). Main reason is that this way I can
see more windows side-by-side.
> • Some people argue, short lines are convenient to read. Probably
> they don't understand the consequences of “use it or loose it” for
> their memory.
It's not short that matters, it's quickly reading. Common words can be
read quickly even when they are long.
Anyway, it's more a personal preference than anything else.
In my opinion vim.function could mean something else than the leader for
all functions. Also because there is a function() function.
Perhaps it should be vim.functions instead of vim.function?
Considering we have vim.windows and vim.buffers. It's not the same
though, windows and buffers are dynamic, the list of functions is fixed.
Well, unless you include user functions.
--
Q: What's orange and sounds like a parrot?
A: A carrot
/// 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.