Find[x; xs]. Found[x]. NotFound[]. &OptimizeFor[]; &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[\]; #Gen_FreeString[R_Symbol[\1]]: \y; &Contains[in; x]. --- Find[#Flush[\x]; \in] &Find[]: Found[\x]; &Contains2[in; x; y]. --- Find[\x; \in] &Find[]: Found[\y]; &Find[]. === Find[\; Nil[]]: NotFound[]; Find[\x; Cons[\y; \]] &IsTrue[x: #Any_Matches[\x; \y]]: Found[\y]; Find[\x; Cons[R_Call[\; \elems]; \]] &Contains2[in: \elems]: 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]; #List_Map[E[\1]; \args]]; E[R_PairList[\elems]]: R_PairList[#List_Map[E[\1]; \elems]];