I need to use the Ada library from Lua. I want to use a generic package, which, along with other data, will contain a function that will register in Lua with different names depending on the data. As I understand it, I should declare this function as "with Export, Convention => C", but when instantiating several instances of such a package, the library will contain several functions with the same names and it will not compile. Is it possible in such a situation not to use "Export", but only the "Convention => C", because only a function reference is used for registration in Lua?
with System; use System;
with Interfaces.C; use Interfaces.C;
generic
type Data is private;
Name : String;
package P is
function Call (Lua : Address) return int
with Export, Convention => C;
function Get_Name return String is (Name);
end P;