Things like that made me give it the sideye for anything more than I could keep in my head at once... if I started needing to look at other files to determine if there was anything odd there... "can I create a function here in this parameter passed to me? What if someone else created a function of the same name before they passed it to me and expected it to remain?"
It can work... but it requires a bit more discipline than the developers I was working with had as a baseline (for that matter, a decade and a half later at a different job with a lower baseline and AI code - the idea of that terrifies me).
It's a "powerful" language, but I think it has too much power.
I like groovy for much the same reason that I liked perl and ruby (to an extent) - but it too is too powerful. It's great for writing scripts where it's a file or two or three... but if the "what does it do" gets too large to keep in my mind at once then it requires more discipline. I like to think that I have that discipline when working solo in groovy (and people will tell me I don't need to be that explicit in the objects... creating a class file rather than just shoving anonymously built objects into a hashmap), but that's how I can come back to old code more easily.
Ruby Conf 2011 Keeping Ruby Reasonable by Joshua Ballanco https://youtu.be/vbX5BVCKiNs
Abstract Heresies : First-class environments https://funcall.blogspot.com/2009/09/first-class-environment...