github.com/elves/elvish@v0.15.0/pkg/eval/vals/feed.go (about)

     1  package vals
     2  
     3  // Feed calls the function with given values, breaking earlier if the function
     4  // returns false.
     5  func Feed(f func(interface{}) bool, values ...interface{}) {
     6  	for _, value := range values {
     7  		if !f(value) {
     8  			break
     9  		}
    10  	}
    11  }