An update…
I thought maybe about using getfield() for this, it seemed apt as I could get the field :x from module, once again pretend that module has underlines around it. That ended up working perfectly. Somehow after pulling my hair out for an hour, and FINALLY deciding to post on the forums, I ended up figuring it out in like a minute after posting. Really, I blame myself for not thinking of getfield() earlier. Here is the new code:
macro each(exp::Expr)
x = exp.args[2]
xname = ""
if contains(string(x), '[')
xname = eval(x)
else
xname = getfield(__module__, Symbol(x))
end
if length(exp.args) == 2
for value in xname
state = eval(Meta.parse(string(exp.args[1], "(", value, ")")))
if state != true
return(false)
end
end
end
for value in xname
state = eval(Meta.parse(string(value," ", exp.args[1], " ", exp.args[3])))
if state != true
return(false)
end
end
return(true)
end
So if anyone is wondering how to get values, and work with values from main from within a module, from expressions, this is at least one working way to do so.