github.com/neilgarb/delve@v1.9.2-nobreaks/_fixtures/find_array.star (about)

     1  def command_find_array(arr, pred):
     2  	"""Calls pred for each element of the array or slice 'arr' returns the index of the first element for which pred returns true.
     3  	
     4  	find_arr <arr>, <pred>
     5  	
     6  Example use:
     7  	
     8  	find_arr "s2", lambda x: x.A == 5
     9  """
    10  	arrv = eval(None, arr).Variable
    11  	for i in range(0, arrv.Len):
    12  		v = arrv.Value[i]
    13  		if pred(v):
    14  			print("found", i)
    15  			return
    16  
    17  	print("not found")