I haven't had time to look at this in detail, but here are a few quick comments. It looks like you've put a lot of work into this - certainly, there's a lot of code there. For that reason, it's hard to know where to start to understand how to use it and (doubly so) how it works. Some examples would certainly be useful. At a casual glance, your 'for' function looks quite complicated to use. Moreover, since the block to be executed is Eval'd in the function scope, it cannot use local variables from the calling environment. That's what I was getting at in . Are you aware of ? It provides a simple for-loop construct (as a language extension, not a function). It also has a block if-then-else which could be used in place of the ugly (IMHO, of course :)) Eval blocks in your code. If you like, you could even write the entire code in the extended GScript language and just use GImport instead of Import to load the files.