make astuple more general
This commit is contained in:
parent
3e42db0cdf
commit
b2d9514a9a
@ -1,11 +1,15 @@
|
|||||||
using DataFlow: interpret, interpret, interptuple, interplambda, interpconst, Context
|
using DataFlow: interpret, interpret, interptuple, interplambda, interpconst, Context
|
||||||
|
|
||||||
function astuple(xs)
|
function astuple(xs::Vertex)
|
||||||
isconstant(xs) && isa(value(xs).value, Tuple) ? value(xs).value :
|
isconstant(xs) && isa(value(xs).value, Tuple) ? value(xs).value :
|
||||||
isa(xs, Vertex) && value(xs) == tuple ? inputs(xs) :
|
isa(xs, Vertex) && value(xs) == tuple ? inputs(xs) :
|
||||||
nothing
|
nothing
|
||||||
end
|
end
|
||||||
|
|
||||||
|
astuple(xs::Tuple) = xs
|
||||||
|
|
||||||
|
astuple(xs) = nothing
|
||||||
|
|
||||||
function astuples(xs)
|
function astuples(xs)
|
||||||
xs = [astuple(x) for x in xs]
|
xs = [astuple(x) for x in xs]
|
||||||
all(x->!(x==nothing), xs) ? xs : nothing
|
all(x->!(x==nothing), xs) ? xs : nothing
|
||||||
|
Loading…
Reference in New Issue
Block a user