How do you import in Genie?

184 views Asked by At

How is one supposed to import modules or libraries in the Genie programming language? I looked through the documentation and examples, but I haven't found anything.

1

There are 1 answers

0
txasatonga On

The method is the same as in Vala:

View documentation

The example can be used with this code:

//--- libreria.gs ---
namespace mate
    def sum(a:int,b:int):int
        return a+b

and you can compile with: valac --library=libreria -H libreria.h libreria.gs -X -fPIC -X -shared -o libreria.so this command creates ".vapi",".h" and ".so" extent files.

I hope this will be helpfull.:>