Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- register_module(Name, Pred, L, !IO) :-
- ( semipure ready(L) ; impure init(L) ),
- semipure (ref(Ref) = function(Pred)
- ; unexpected($module, $pred,
- "function/1 did not return a ref.").
- ),
- impure lua_getregistry(L, LUA_RIDX_MR_MODULE), /* table -3 */
- impure lua_pushstring(L, N), /* key -2 */
- impure luaMR_pushref(L, R), /* value -1 */
- impure lua_settable(L, -3), /* table -1 */
- impure lua_pop(L, 1). /* empty stack */
- :- pragma promise_pure(register_module/5).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement