Builtin methods done

18 views
Skip to first unread message

Bram Moolenaar

unread,
Sep 8, 2019, 4:20:47 PM9/8/19
to vim...@googlegroups.com

With this patch:

> Patch 8.1.2012
> Problem: More functions can be used as methods.
> Solution: Make terminal functions usable as a method. Fix term_getattr().
> Files: runtime/doc/terminal.txt, src/evalfunc.c, src/terminal.c
> src/testdir/test_mksession.vim, src/testdir/test_terminal.vim

I finished making all relevant builtin functions available as methods.
For many functions this works nicely. For some it is not obvious what
argument to use for the base. I tried to keep it predictable. For some
it would just be confusing, thus I didn't add support to use the
function as a method.

Example of useful method chaining:

call readfile("input.txt")
\ ->filter('v:val !~ "^#"')
\ ->map('toupper(v:val)')
\ ->writefile("output.txt")

Let me know if you think using some builtin functions as a method
doesn't work predictably.

--
hundred-and-one symptoms of being an internet addict:
224. You set up your own Web page. You set up a Web page for each
of your kids... and your pets.

/// Bram Moolenaar -- Br...@Moolenaar.net -- 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 ///
Reply all
Reply to author
Forward
0 new messages