[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Help on lproc exercise, Listing 31.6
- From: Andrew Starks <andrew.starks@...>
- Date: Tue, 29 Oct 2013 15:18:03 -0500
I'm trying to slog this out on my own, but either I'm working with a
typo or I missed something...
In listing 31.6, the first line reads:
` static const struct luaL_reg ll_funcs[] = {`
I didn't see this in the errata, (or in the thread that is currently
arguing about memoization :)
So, I'll assume that it should be `luaL_Reg`, instead of the olde
`luaL_reg`. Am I correct?
Second, and this is what has me tripped up, again in listing 31.6,
second to the last line of `luaopen_lproc`:
` luaL_register(L, "lproc", ll_funcs); /* open library */`
After reading a bunch, I understand that `luaL_register` was a
"thing", but now it is gone, at least in my binary or in my luaconf.
Unlike luaL_r|Reg, the solution to this one is less than obvious to
someone inexperienced enough to be reading through a tutorial on the
C-API.
I humbly suggest that refactoring the example would be helpful.
Searching the text and the reference manual makes no mention of the
deprecation and this results in a walk down the, "it's my fault, it's
a type-o, I'm dumb, google, oh..." path, for newbies like me.
Thanks!
--Andrew