I wrote:
> Patch 8.1.1803
> Problem: All builtin functions are global.
> Solution: Add the method call operator ->. Implemented for a limited number
> of functions.
> Files: runtime/doc/eval.txt, src/eval.c, src/structs.h,
> src/userfunc.c,
> src/globals.h, src/evalfunc.c, src/proto/evalfunc.pro,
> src/testdir/test_method.vim, src/testdir/Make_all.mak
For now this makes a few existing functions available as methods, e.g.
mylist->filter(filterexpr)->map(mapexpr)->sort()->join()
It's a lot easier to read than:
join(sort(map(filter(mylist, filterexpr), mapexpr)))
When we add new methods for List, Dict, etc. we can now make them local
to those objects, instead of adding them globally.
I decided to use "->" because of the similarity with C pointer usage.
It would be nice to use ".", but I'm quite sure that won't be backwards
compatible, especially when using a Dict.
Comments are welcome!
--
hundred-and-one symptoms of being an internet addict:
21. Your dog has its own home page.
/// 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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/201908032029.x73KTTAD002951%40masaka.moolenaar.net.