On Wed, Jan 11, 2023 at 3:33 PM N i c o l a s <[email protected]> wrote:
> Hi,
>
> Is it possible to create its own lambda function ?
>
> I explain I got this def func :
>
> def *OutBufAdd*(outbuf: list<string>, str: string)
> EchoMsg(str)
> outbuf->add(str)
> enddef
>
> Client code is using it as this :
> OutBufAdd(outbuf, 'foo')
> ....
> OutBufAdd(outbuf, 'bar')
> ....
> OutBufAdd(outbuf, 'barfoofoo')
> ....
> OutBufAdd(outbuf, 'barbar')
>
> Regarding this, it is always in this case OutBufAdd(outbuf, somestring)
>
> Is it possible to modify OutBufAdd(outbuf, somestring ) to
> OutBufAdd->(somestring) ?
>
> Thank you for all
> Nicolas
>
:help Partial
You should be able to do this or a variation thereof from here:
var Adder: func: any = function('OutBufAdd', [outfbuf])
Adder(something)
Hope this helps,
Salman
--
--
You received this message from the "vim_use" 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_use" 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_use/CANuxnEc%3D0v-kXDhYPf74kQRQZ3M_-pmDzgUdNFq-MfcQ8tWR%2BQ%40mail.gmail.com.