To: vim_dev@googlegroups.com Subject: Patch 7.4.2121 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.2121 Problem: No easy way to check if lambda and closure are supported. Solution: Add the +lambda feature. Files: src/evalfunc.c, src/version.c, src/testdir/test_lambda.vim *** ../vim-7.4.2120/src/evalfunc.c 2016-07-28 22:53:33.161059376 +0200 --- src/evalfunc.c 2016-07-29 22:44:01.555601538 +0200 *************** *** 5205,5210 **** --- 5205,5211 ---- #ifdef FEAT_KEYMAP "keymap", #endif + "lambda", /* always with FEAT_EVAL, since 7.4.2120 with closure */ #ifdef FEAT_LANGMAP "langmap", #endif *** ../vim-7.4.2120/src/version.c 2016-07-29 22:36:40.211701392 +0200 --- src/version.c 2016-07-29 22:49:37.904473686 +0200 *************** *** 304,309 **** --- 304,314 ---- #else "-keymap", #endif + #ifdef FEAT_EVAL + "+lambda", + #else + "-lambda", + #endif #ifdef FEAT_LANGMAP "+langmap", #else *** ../vim-7.4.2120/src/testdir/test_lambda.vim 2016-07-29 22:36:40.207701429 +0200 --- src/testdir/test_lambda.vim 2016-07-29 22:49:03.976789265 +0200 *************** *** 1,5 **** --- 1,9 ---- " Test for lambda and closure + function! Test_lambda_feature() + call assert_equal(1, has('lambda')) + endfunction + function! Test_lambda_with_filter() let s:x = 2 call assert_equal([2, 3], filter([1, 2, 3], {i, v -> v >= s:x})) *** ../vim-7.4.2120/src/version.c 2016-07-29 22:36:40.211701392 +0200 --- src/version.c 2016-07-29 22:49:37.904473686 +0200 *************** *** 760,761 **** --- 765,768 ---- { /* Add new patch number below this line */ + /**/ + 2121, /**/ -- A programmer's wife asks him: "Please run to the store and pick up a loaf of bread. If they have eggs, get a dozen". The programmer comes home with 12 loafs of bread. /// Bram Moolenaar -- Bram@Moolenaar.net -- 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 ///