A new method is introduced to GLUEscript: require. This method can be used to load glues. The method returns an object which contains all the classes and methods that are defined in the specific glue. The glue attaches this object also on the glue.modules object. require needs a URI to the glue. For a glue this must be a file URI. The object returned by require can be used to create shorter code. An example:
var os = require("file:///c:/development/gluescript/bin/debug/glue_os.dll");
This example will load the glue_os glue. The object that contains all classes is stored in the os variable. This mean you can write something like this:
var file = new os.File("test.txt");
Which is a shorthand for writing this:
var file = new glue.modules.os.File("test.txt");
The object created by the glue is cached in the runtime. So calling require twice or more for the same glue, will not result in loading the glue again.
In the future it will also be possible to use require for loading modules written in JavaScript.