Am 31.08.2019 um 21:07 schrieb Bram Moolenaar:

Andy Wokula wrote:

Am 31.08.2019 um 19:14 schrieb Bram Moolenaar:
! <                                                          *globpath()*
    globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]])
                Perform glob() on all directories in {path} and concatenate
                the results.  Example: >
***************
*** 5696,5701 ****
--- 5722,5731 ----
    <                Upwards search and limiting the depth of "**" is not
                supported, thus using 'path' will not always work properly.

+               Can also be used as a|method|, the base is passed as the
+               second argument: >
+                       GetExpr()->globpath(&rtp)

You think, to be consistent with glob(), the base must be passed as
the *second* argument?  I wonder what your reason is here, it's quite
unexpected.

In a chain what gets passed is the object that is being processed.
In this case I would say the expression is processed, while the path is
a parameter indicating how to process the expression.

        eval GetPattern()->glob()->ListResults()
        eval GetPattern()->globpath(&rtp)->ListResults()

Did you expect that with -> the base is always passed as the first
argument?  That doesn't work well for some existing functions.

It works well with globpath(), that's why it's unexpected.
Is there some other rule which prevents users from looking up :help for every 
function?
Or are there just a few exceptions?

Rules for example
- base is passed as first argument
- doesn't work well for: printf(), setline(), strftime(), append(), ... other 
easy to guess functions
- "exceptions", base anyway passed as second argument: globpath(), ...

--
Andy

--
--
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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/5D6B7E28.6010907%40yahoo.de.

Reply via email to