Hi
I hope vim can treat list argument for or()/and()/xor().
Currently, spec is two arguments. or({expr}, {expr}).
But many of case I want is:
-------
let FLAG1 = 0x0001
let FLAG2 = 0x0002
let FLAG3 = 0x0004
if (s:check_flag([FLAG1, FLAG2, FLAG3])
" do something
endif
-------
If you write above in current vim,
-------
let FLAG1 = 0x0001
let FLAG2 = 0x0002
let FLAG3 = 0x0004
echo or(or([FLAG1, FLAG2), FLAG3])
-------
It is lengthy. I thought about variadic function/arguments. But vim dont
support true variadic function.
printf() has limit of arguments 19. So I wrote a patch to accept list the
argument.
https://gist.github.com/1751166
https://raw.github.com/gist/1751166/gistfile1.diff
This is patch for suggestion. Is this better to write separated in doc like
below?
and( {expr}, {expr}) Number bitwise AND
and( {list} ) Number bitwise AND
Thanks.
- Yasuhiro Matsumoto
--
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