lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


2014-03-15 11:14 GMT+02:00 steve donovan <steve.j.donovan@gmail.com>:

> It's very true that a higher-level C++ API will be safer. E.g. this is
> the kind of scheme any half-competent C++ programmer could organize in
> an hour or so:
>
> LState state(L);
> LRef strfind(L,"string.find");
> int i1,i2;
> strfind.push();
> state << "hello dolly" << "dolly";
> state.call(2,2);
> state >> i1 >> i2;
>
> where the familiar iostream pattern is now overloaded to mean pushing
> and popping stack values.

Seven lines of code take "an hour or so". I thought that was intentionally
humorous, but it actually seems to be the going rate for C++.

Lua has spoilt me ...