Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

loadstring() string.dump() and the creation of dynamic functions (DOC UPDATE REQUEST)

in General Posts: 108

I had tracked down string.dump() in the built in help a while back, the documentation mentions ‘a later “load” on this string returns a new function’

I just now realized the “CODEA within CODEA” code from the forum must use something like this, and finally discovered “loadstring()” in the main code, not string.load() which I was assuming from the string.dump() documentation.

I suggest a small update in the doc to include some info on load and a related link to it from dump, and possibly adding string.load() to CODEA to keep the same structure. I also suggest considering the addition of ‘CODEA within CODEA’ as a built in example project, as it is very powerful and exciting/inspiring project that I may never have found without scouring the forum for months, and deserves more attention.

This is an extremely powerful, potentially highly efficient way to go about creating functions on the fly, especially for my purposes. I am creating update() functions for GLSL uniforms dynamically by parsing any shader with Regex, and I think this will also work great for generating callback functions for GUI. Theoretically this could create streamlined updates that need to happen in the draw loop or as callbacks.

Sign In or Register to comment.