You're almost correct :-) There is two methods of loading primitives:
1. $loader.loadmodule(), which should be used for loading external compiled
NekoVM files written in Neko.
2. $loader.loadprim() which used for loading primitives from C librariesm
like std, date and so on.
For example, we have an Neko object called DateClass
-------cut here------
// this is date-class.neko file
DateClass = $new(null);
DateClass.now = $loader.loadprim("[EMAIL PROTECTED]", 0);
$exports.DateClass = DateClass;
-------cut here------
Next, we want to use this neko module in other application:
-------cut here------
// import DateClass from date-class.n file
DateClass = $loader.loadmodule('date-class', $loader).DateClass;
// use our DateClass object
my_date = $new(DateClass);
$print(my_date.now());
-------cut here------
P.S. I don't test this code, but I hope the idea how to use loaders is clear
;-)
--
BR,
Vitali Falileev
http://blog.insideable.com
ICQ: 75008864
2007/8/16, Athanasios Anastasiou <[EMAIL PROTECTED]>:
>
> Hello Vitali
>
> Thanks for your email.
>
> I was examining this page after all else failed but still there is no
> meaningful output from my short piece of code.
>
> By the way the example you sent throws an "Invalid Call" exception.
>
> Now, from this page:
> http://nekovm.org/doc/libs
>
> I am interested in loading one of the modules of the Standard Library
> and more specifically the Date module. Please note that i need _ALL_ the
> primitives from this module.
>
> So the loader should be -i suppose- something like:
>
> var DateClass=$loader.loadmodule("date",$loader);
>
> or
>
> var DateClass=$loader.loadmodule("[EMAIL PROTECTED]",$loader);
> (Although the [EMAIL PROTECTED] would make more sense)
>
> However none of these does what it is expected to do. I get an exception
> that the module can not be found. By the way i have added my neko
> location to the path....
>
> Any ideas on this?
>
>
>
>
> --
> Neko : One VM to run them all
> (http://nekovm.org)
>
--
Neko : One VM to run them all
(http://nekovm.org)