Module RFC Questions #362
-
The changes and new features from Sanny Builder 4 and CLEO5 is overwhelming. So I'll start with two questions regarding the most interesting Dynamic Link Library like implemented in CLEO5. Since I don't quite understand the overall behavior of how cleo5 manages all shared functions. Supposed I have "n" number of shared functions and this code that imports some of them:
For my first question. How will organizing my shared functions affect the performance cleo 5 during the main looping process? I'm having split thoughts about which of these two is more efficient for cleo 5 when looping:
For my second question. Supposed the following folder structure
How can I import "funcs.mod" to "script.cs"? Do we support relative paths? For example: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi! Good questions out there. Modules are very new so bear in mind the implementation / guidelines may change as we find more use cases. For the first question, I would start with one module first and then as my module grows split it to smaller modules. There is no overhead in calling modules other than for the first call CLEO must load it in memory, and then it works just like any SCM function. For the second question, modules are loaded relative to the script's directory. You can use a virtual path prefix like In your example /cc @MiranDMC |
Beta Was this translation helpful? Give feedback.
Hi! Good questions out there.
Modules are very new so bear in mind the implementation / guidelines may change as we find more use cases.
For the first question, I would start with one module first and then as my module grows split it to smaller modules. There is no overhead in calling modules other than for the first call CLEO must load it in memory, and then it works just like any SCM function.
For the second question, modules are loaded relative to the script's directory. You can use a virtual path prefix like
cleo:\
orroot:\
to load them from a specific folder, ignoring modloader.In your example
import func1 from "..\..\Library\cleo\funcs.mod
should work, but let me know if it doesn't.