Welcome, Guest
Username: Password: Remember me
Components and Libraries for Scripting Development, discussions, problems and suggestions
  • Page:
  • 1

TOPIC:

Lua! 11 years 10 months ago #3020

  • 4aiman
  • 4aiman's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Comix creator
  • Posts: 227
  • Thank you received: 12
There are 2 units available in the CT 3.1 which has LUA in their names:
lua, lualib
.
On the other side I have this little demo shared library project written in C:
#include <iostream>
#include <luabind/luabind.hpp>

void greet()
{
    std::cout << "hello world!\n";
}

extern "C" int init(lua_State* L)
{
    using namespace luabind;

    open(L);

    module(L)
    [
        def("greet", &greet)
    ];

    return 0;
}
Original

How could I port that to work within CT?

Warning: Spoiler!

I'm starting to doubt there are no mistakes in my DNA... 'Cause before I unchecked -WR option CT was complaining about it's "illegal-ity" :(

Anyone knows smth?

I can find an alternative by testing every lua_open* function, but what's this supposed to mean:
module(L)
    [
        def("greet", &greet)
    ];
コンソールマニアック

Please Log in or Create an account to join the conversation.

Last edit: by 4aiman. Reason: have found liblua5.1.so.0.0.0 O_o

Lua! 11 years 10 months ago #3033

  • avra
  • avra's Avatar
  • Visitor
  • Visitor
one of the pages I got after googling for lua lualib delphi:
www.codeforge.com/read/85205/lualib.pas__html
Look at LuaTestmain.pas

Please Log in or Create an account to join the conversation.

Last edit: by avra.

Lua! 11 years 10 months ago #3034

  • 4aiman
  • 4aiman's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Comix creator
  • Posts: 227
  • Thank you received: 12
Thanks! Googled for 8 hours but hadn't come across that.
The "bad" thing is that's "unconvertable", 'cause of some undefined functions and types.
Maybe there are some fpc example? that'll do too.
コンソールマニアック

Please Log in or Create an account to join the conversation.

Lua! 11 years 9 months ago #3271

  • 4aiman
  • 4aiman's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Comix creator
  • Posts: 227
  • Thank you received: 12
Uhm... Bump?..
コンソールマニアック

Please Log in or Create an account to join the conversation.

Lua! 11 years 9 months ago #3300

  • Arioch
  • Arioch's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 59
  • Thank you received: 1
Well, there are two Lua bindings for Delphi. Considered their adaptation for FPC ?

Please Log in or Create an account to join the conversation.

Lua! 11 years 9 months ago #3301

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4535
  • Thank you received: 1114
Look at CT FPC packages

codetyphon\fpcsrc\packages\lua\src
PilotLogic Architect and Core Programmer
Attachments:

Please Log in or Create an account to join the conversation.

Lua! 11 years 9 months ago #3302

  • Arioch
  • Arioch's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 59
  • Thank you received: 1
"LAUxlib" ? :-D

Please Log in or Create an account to join the conversation.

Lua! 11 years 9 months ago #3312

  • 4aiman
  • 4aiman's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Comix creator
  • Posts: 227
  • Thank you received: 12
I have looked at that, but, as I've said before, I can find an alternative for this:
module(L)
    [
        def("greet", &greet)
    ];

How can I do this?

PS: I can't look at anything atm, because of this: www.pilotlogic.com/sitejoom/index.php/fo...untu-12-04-mate#3311
コンソールマニアック

Please Log in or Create an account to join the conversation.

  • Page:
  • 1