Search notes:

vim script: extend

" ../run_ extend
redir > extend.out

let s:list_1  = [0, 1, 2, 3 ]
let s:list_2  = ['a','b','c']

call extend(s:list_1, s:list_2)
echo string(s:list_1)
" [0, 1, 2, 3, 'a', 'b', 'c']


let s:list_1  = [0, 1, 2, 3 ]
let s:list_2  = ['a','b','c']

call extend(s:list_1, s:list_2, 1)
echo string(s:list_1)
" [0, 'a', 'b', 'c', 1, 2, 3]


let s:dict_1 = {'foo': 'Phoe', 'bar': 'Bhar'}
let s:dict_2 = {'baz': 'Buhs'}

call extend(s:dict_1, s:dict_2)
echo string(s:dict_1)
" {'foo': 'Phoe', 'baz': 'Buhs', 'bar': 'Bhar'}

redir END
q
Github repository about-vim, path: /vimscript/functions/extend.vim

See also

Vim: built in functions
VIM script

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758184338, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/vim/script/vimscript/functions/extend(68): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78