Hi mattn,

2016/4/18 Mon 0:30:19 UTC+9 mattn wrote:
> Hi, Bram and list.
> 
> Updated lambda patch to be applied for latest code.
> 
> https://gist.github.com/mattn/5bc8ded21e1033c9c0ea8cd5ecbbce11
> 
> This include examples for timer on help file. I'm thinking lambda() have 
> cooperative to work with job/timer/channel.
> 
> So I hope to add this into vim8. How do you think?
> 
> Thanks to k-takata, haya14busa, and all of members on vim-jp.

I have tested the lambda patch with the latest Vim and I found two problems.

  1. garbagecollect_for_testing() was renamed.
  2. Test_lambda_with_timer() fails on Cygwin. It seems that we need margins
     as we do in test_timers.vim.

Please check attached patch.

I hope that the lambda patch will be merged in Vim 8.0.
This makes filter(), map() and sort() easy to use.
It also works nicely with job/channel/timer features.

Regards,
Ken Takata

-- 
-- 
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.
# HG changeset patch
# Parent  f8fe6495a290331be16b44f4b1f0f197f4485b4e

diff --git a/src/testdir/test_lambda.vim b/src/testdir/test_lambda.vim
--- a/src/testdir/test_lambda.vim
+++ b/src/testdir/test_lambda.vim
@@ -235,12 +235,15 @@ function! Test_lambda_with_timer()
   endfunction
 
   call s:Foo()
-  sleep 100ms
+  sleep 200ms
   " do not collect lambda nor l:n in lambda
-  call garbagecollect_for_testing()
-  sleep 100ms
+  call test_garbagecollect_now()
+  let m = s:n
+  sleep 200ms
   call timer_stop(s:timer_id)
-  call assert_true(s:n > 3)
+  call assert_true(m > 1)
+  call assert_true(s:n > m + 1)
+  call assert_true(s:n < 9)
 endfunction
 
 function! Test_lambda_with_partial()

Raspunde prin e-mail lui