2016-04-20 14:46 GMT+03:00 Bram Moolenaar <[email protected]>:
>
> Björn Linse wrote:
>
>> > The NULL is supposed to be the same as an empty, mutable list. This is
>> > tricky, because code that expects a list needs to check for the NULL and
>> > create the list if needed.
>>
>> how could this be possible?
>>
>> let x = getreg("a",1,1) " returns NULL
>> let y = x
>> call add(x, "text")
>>
>> now x is created, but y is still NULL, inconsistent with if x referred
>> to an non-NULL empty list.
>
> OK, yes, in that case it is different from a real empty list.
> Do we really case about that?
Do you really want to state in documentation “lists are passed by
reference, but *some* empty lists are passed by value”? If I got
mutable empty list from somewhere I expect it to work as mutable empty
list. E.g. I could use
function Extender(lines)
call extend(a:lines, systemlist('echo abc'))
endfunction
. Now pass v:_null_list to Extender: what will it do? `a:lines` is a
new variable, destroyed after function exits.
>
> --
> Nothing is impossible for the man who doesn't have to do it.
>
> /// 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].
> For more options, visit https://groups.google.com/d/optout.
--
--
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].
For more options, visit https://groups.google.com/d/optout.