Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Is there any command can turn a Proc into a string of codes?

Hideo

Member

Hello everyone,

I have problem in saving a class by Marshal.dump when the class contains Proc inside. So I want to find a way to turn the Proc into a string if that's possible. Otherwise I may need to remove all the proc objects and turn them into strings perhaps.

So my question is that:

We have a command called eval which can turn a string into program code and run, so in the opposite, will there be any command which can turn a block or proc object into a string of codes?

Thanks all.
 
Nope there is no way that I know of, and I checked to make sure there is not a way to convert a Proc object into a string representing the block of code that will be excuted when the proc is called
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top