r - collapse a list of unevaluated expressions to single expression -


having following list of unevaluated expressions.

l = list(quote(f()),quote(g()),quote(h())) str(l) #list of 3 # $ : language f() # $ : language g() # $ : language h() 

i collapse list using & function following r result.

r = quote(f() & g() & h()) str(r) # language f() & g() & h() 

of course point handle list of length.

you can use reduce this:

reduce(function(a,b) bquote(.(a) & .(b)), l) 

Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -