func Select(fns ...Operation) Operation {
	return func(tx *Tx) interface{} {
		switch len(fns) {
		case 0:
			// empty Select blocks forever
			tx.Retry()
			panic("unreachable")
		case 1:
			return fns[0](tx)
		default:
			oldWrites := tx.writes
			tx.writes = make(map[*Var]interface{}, len(oldWrites))
			for k, v := range oldWrites {
				tx.writes[k] = v
			}
			ret, retry := catchRetry(fns[0], tx)
			if retry {
				tx.writes = oldWrites
				return Select(fns[1:]...)(tx)
			} else {
				return ret
			}
		}
	}
}
// Select runs the supplied functions in order. Execution stops when a
// function succeeds without calling Retry. If no functions succeed, the
// entire selection will be retried.
Select runs the supplied functions in order. Execution stops when a
function succeeds without calling Retry. If no functions succeed, the
entire selection will be retried.
// Select runs the supplied functions in order . Execution stops when a // function succeeds without calling Retry . If no functions succeed the // entire selection will be retried .
func Select(fns ...Operation) Operation {
	return func(tx *Tx) interface{} {
		switch len(fns) {
		case 0:
			tx.Retry()
			panic("unreachable")
		case 1:
			return fns[0](tx)
		default:
			oldWrites := tx.writes
			tx.writes = make(map[*Var]interface{}, len(oldWrites))
			for k, v := range oldWrites {
				tx.writes[k] = v
			}
			ret, retry := catchRetry(fns[0], tx)
			if retry {
				tx.writes = oldWrites
				return Select(fns[1:]...)(tx)
			} else {
				return ret
			}
		}
	}
}
func Select ( fns ... Operation ) Operation { return func ( tx * Tx ) interface { } { switch len ( fns ) { case 0 : tx . Retry ( ) panic ( " " ) case 1 : return fns [ 0 ] ( tx ) default : oldWrites := tx . writes tx . writes = make ( map [ * Var ] interface { } , len ( oldWrites ) ) for k , v := range oldWrites { tx . writes [ k ] = v } ret , retry := catchRetry ( fns [ 0 ] , tx ) if retry { tx . writes = oldWrites return Select ( fns [ 1 : ] ... ) ( tx ) } else { return ret } } } }
Select runs the supplied functions in order.
Select runs the supplied functions in order .
// empty Select blocks forever