def where(x, upper_level=[]):
if type(x[0]) != list:
return sum([(upper_level+[i])*e for i,e in enumerate(x)],[])
else:
return [where(e, upper_level + [i]) for i,e in enumerate(x)]
^ multidimensional where
@lyxal i have a problem, there are 2 atoms for the left and right argument of the chain but i dont know how to implement it. if i import atoms in chains.py it causes a circular import. i think i have to keep the evaluation in a separate file.