Hi, I wrote some minimal haxe classes, compiled them and watched generated neko source. It was interesting to look at, I see you also add some standard libraries into the .neko file. I didn't came to any solution though, but I did find a hopefully good way to ask about it.
You have a very nice example called "embedding the vm" at http://nekovm.org/doc/vm There is a C source code and below the neko source code like this: $exports.x = 33; $exports.f = function(x) { return x * 2 + 1; } This is all no problem to me, C and neko side works and all. But can you Nicolas or anybody else please show me what would the Haxe version of this small example be. A Haxe code that after compiled to .n exports some value x and some function f that calculates something. If such thing is possible? I would be really really gratefull and I buy you drinks if you ever come into range of 50km near me! Best regards, Janko On Thu, Oct 9, 2008 at 4:17 AM, janko metelko <[EMAIL PROTECTED]> wrote: > btw: this is the working sample if you have windows -- > http://itmmetelko.com/storage/neko_plus_ptk.zip > > you can change and recompile the mymodule.neko file and see the efect. > > BR > Janko > > > On Thu, Oct 9, 2008 at 1:32 AM, janko metelko <[EMAIL PROTECTED]> wrote: > >> I am not 100% sure if we are still not talking about 2 different things. >> >> First, you need to wrap your neko libraries to be usable from haXe. That's >>> what neko.net.Socket is doing for instance. >> >> >> For example I have no neko libraries that I need to wrap. I am not trying >> to wrap any libraries here but embed nekovm. >> >> I will not nag you any more for now, I will try to get a better >> understanding of the whole thing (I see there is --neko-source option in >> haxe compiler so I will play with that) . Maybe then I can ask the right >> questions or understand your answers. :) >> >> Thanks, I love what you are making and are enabling with haxe and neko >> (and mod_tora sounds cool) >> >> Janko >> >> >> >>> >>> >>> Then, you can compile the haXe module as .n >>> >>> The export table will contain a single entry called "classes", which >>> contain the whole classes and packages that have been compiled by haXe. >>> >>> You can then access to a given class for example by using : >>> >>> $exports.my.package.MyClass >>> >>> (or the equivalent by using Neko API) >>> >>> You can create an instance by calling MyClass.new(p1,p2,...) and the >>> call the methods etc. >>> >>> Hope that helps, >>> Nicolas >>> >>> >>> >>> -- >>> Neko : One VM to run them all >>> (http://nekovm.org) >>> >> >> >
-- Neko : One VM to run them all (http://nekovm.org)
