Re: [vim/vim] continue in foreach lambda (Issue #18880)

15 views
Skip to first unread message

zeertzjq

unread,
2:33 AM (18 hours ago) 2:33 AM
to vim/vim, Subscribed
zeertzjq left a comment (vim/vim#18880)

Are there any other languages that support this kind of continue behavior?


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18880/3621783122@github.com>

Maxim Kim

unread,
2:47 AM (18 hours ago) 2:47 AM
to vim/vim, Subscribed
habamax left a comment (vim/vim#18880)

Describe alternatives you've considered
Instead of a foreach, I could use a for elem in list; but this loses the index within the loop body. I could use a for idx in range([start], [end]) with the boundaries of the list; but writing this is cumbersome.

vim9script

var myList = ["Hello", "World", "I", "Need", "Indices"]

for [idx, value] in items(myList)
    echo idx value
endfor


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18880/3621790787@github.com>

dkearns

unread,
3:47 AM (17 hours ago) 3:47 AM
to vim/vim, Subscribed
dkearns left a comment (vim/vim#18880)

I think you just want return there.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18880/3621826995@github.com>

Igbanam

unread,
12:19 PM (8 hours ago) 12:19 PM
to vim/vim, Subscribed
igbanam left a comment (vim/vim#18880)

I guess return 0 works. I didn't know this option. Thanks for sharing this @zeertzjq


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18880/3622593481@github.com>

Igbanam

unread,
12:19 PM (8 hours ago) 12:19 PM
to vim/vim, Subscribed

Closed #18880 as completed.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/18880/issue_event/21411313122@github.com>

Igbanam

unread,
12:26 PM (8 hours ago) 12:26 PM
to vim/vim, Subscribed
igbanam left a comment (vim/vim#18880)

@zeertzjq what would be the break equivalent?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18880/3622608106@github.com>

Reply all
Reply to author
Forward
0 new messages