Hello
This is one of the new features provided by Ring 1.25 (under development)
This new function introduces dynamic renaming (aliasing) of built‑in C functions inside the Ring VM.
This happens at the VM level, not at the script level, so it’s fast and transparent.
Example:
RingVM_TranslateCFunction("len","length")
RingVM_TranslateCFunction("length","mylength")
cStr = "welcome"
? len(cStr)
? length(cStr)
? mylength(cStr)
Output:
(1) The value of this function comes when creating an Arabic version of Ring where it's not easy to create a one wrapper for specific functions like SubStr() without changing the function parameters. SubStr() accept different no. of parameters, while Ring function uses Lists for this purpose. Using RingVM_TranslateCFunction() we can quickly get another Arabic name for SubStr() that works using the same way.
(2) With respect to translating Ring packages, classes, methods and functions, this is easy and doesn't require a specific function at the language level, where using Ring code we can create a library that generate such wrappers.
Greetings,
Mahmoud