Find[x; xs]. Found[x]. NotFound[]. &Setup[]; &OptimizeFor[]; &Setup[]. --- \x: A["OptimizeFor"; \x]; E[&RecurseR[]]; &OptimizeFor[]. === A["OptimizeFor"; r' for (\i in \iter) { ...\in } '] &Env[] &Contains[x: r'\x[[\i]] <- \_']: r' if (is.data.frame(\x)) { \y <- as.list(\x) for (\i in \iter) { ...\in } \x <- as.data.frame(\y) } ' &Subst[old: r'\x[[\i]] <- \expr'; new: r'\y[[\i]] <- \expr']; E[&RecurseR[]]; &Env[i; x; y]. --- \i: R_Symbol[\]; \x: R_Symbol[\]; r'y': \y; &Contains[in; x]. --- Find[#Flush[\x]; \in] &Find[]: Found[\x]; &Find[]. === Find[\; Nil[]]: NotFound[]; Find[\x; Cons[\y; \]] &IsTrue[x: #Any_Matches[\x; \y]]: Found[\y]; Find[\x; Cons[\; \xs]]: Find[\x; \xs]; &SubstIn[in; old; new]. --- \in: \in &Subst[]; E[Cons[\fst; \rst]]: Cons[E[\fst]; E[\rst]]; E[R_Call[R_Symbol["{"]; \exprs]]: R_Call[R_Symbol["{"]; E[\exprs]]; E[R_PairList[\exprs]]: R_PairList[E[\exprs]]; E[&RecurseR[]]; &Subst[old; new]. === \old: \new; E[&RecurseR[]]; &IsTrue[x]. --- \x: True[]; &RecurseR[]. --- E[R_Call[\fun; \args]]: R_Call[E[\fun]; #Base_Map[E[Hole[1]]; \args]]; E[R_PairList[\elems]]: R_PairList[#Base_Map[E[Hole[1]]; \elems]];