How to compile erlang code loaded into a string?

前端 未结 2 838
南旧
南旧 2021-02-04 19:26

I have a generated string that contains the code for an erlang module.

Is there a way to compile the generated module straight from the string?

Or is there a w

2条回答
  •  不知归路
    2021-02-04 20:19

    Store the content of the string in a file with a module name (if not there in the code) and compile it using compile module.
    Code becomes available in the VM. I am using this technique to convert a configuration file into a module. This way there not much binary copy going on during the execution.

提交回复
热议问题