FYI, I think (and my testing shows) there IS a way to handle this without eval. Use the alternate AssociativeArray syntax (square brackets).
function testclass() as object
this = {
foo: "bar"
func: function() as boolean
print "in method, foo is "; m.foo
for each attr in m
print " found "+attr+" in m"
end for
end function
}
return this
end function
sub main()
c=testclass()
c.func()
c["func"]()
end sub
You get this output, which implies c.func() and c["func"]() result in the same behavior.
in method, foo is bar
found func in m
found foo in m
in method, foo is bar
found func in m
found foo in m
That seems to imply it's not really the dot operator, but the associative array existence that sets m. I don't know whether this was changed since this was mentioned here, just noting how I see it working currently.